r/nocode • u/easybits_ai • 3d ago
Question Storing generated PDFs in Postgres vs object storage: where do you draw the line?
/r/n8nforbeginners/comments/1y6s8sq/storing_generated_pdfs_in_postgres_vs_object/
2
Upvotes
2
u/suubu-crtiv 2d ago
i'd default to object storage like s3 and keep just the key, size and checksum in postgres. bytea is ok under ~1MB at low volume, but backups and replication bloat up fast beyond that.
2
u/Rishiraj-Tshaka 2d ago
for low volume internal tools, keeping it in the database is totally fine imo. the main annoyance you'll actually hit first isn't query speed, it's database backups getting bloated and slow.
2
u/Common-Potential2441 2d ago
Keep it in Postgres at your volume. A few PDFs a month won't hurt you, and backups already cover them. I'd move to object storage when row size starts dragging queries or backups, not before.
3
u/AnswerVinod 2d ago
i have been on both sides of this one. base64 in postgres is fine while it is a few pdfs a month, it keeps life simple and backups cover everything in one place. the line for me is when the table starts getting big or downloads get frequent, base64 also bloats every row by about a third and slows your backups down. then i move the file to object storage and keep only the key, size and checksum in the row, like others said. generate once at approval is the right call either way, never pay for the conversion twice.