Storing User Documents: Database Blobs Versus Object Storage for Large Files
For most SaaS document uploads, the recommended approach is to keep file bytes in object storage while saving searchable metadata in a relational database like Postgres or MySQL. This separation tends to scale more cheaply and keeps the database smaller and faster, with a clearer audit trail. Large files such as scanned contracts can turn a database-blob design into a backup and replication burden. The article suggests the database row act as the source of truth, storing ownership, status, checksum, and an object key, and it advises using unique keys per upload so originals are never silently overwritten. It also compares options including Postgres bytea, Amazon S3, Cloudflare R2, and MinIO, noting that Postgres can still suit small, tightly coupled files.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in