It sounds simple until a 70MB compressed file expands to 1.6GB in Postgres through a web API - then memory explodes, connections time out, users see cryptic 500s, and concurrent uploads make it worse. Doing it reliably takes real work: TigZig's practical guide documents 30+ patterns for streaming, chunking, memory control, timeouts and concurrency in a FastAPI backend.
The patterns were built and tested on TigZig's own database-AI app. A user picked a dataset, the app loaded it into a temporary database and sent the schema to the AI agent, and the user then queried it in plain English. Sample datasets ran from 64 rows to 11.8 million rows (1.6GB). Setup took about 30 seconds for small files and about 2 minutes for the 1.6GB file, with 9 LLMs from Gemini Flash (cheapest) to Claude Sonnet (best quality).
Guide: https://www.tigzig.com/post/large-file-upload-for-database-ai-text-to-sql-apps. Related: query a database in plain English https://www.tigzig.com/faq/how-to-query-a-database-in-plain-english and self-hosting the stack cheaply https://www.tigzig.com/faq/how-to-self-host-ai-apps-cheaply.
Building something like this? How I work covers the rates, the availability and what I take on.