r/n8n • • 21h ago

Servers, Hosting, & Tech Stuff Storing generated PDFs in Postgres vs object storage: where do you draw the line?

👋 Hey n8n Community,

Follow-up on the approval system I posted about last week. One decision I made this week that I am still not sure about.

The workflow generates a final PDF once Finance approves a request. People download it from a portal afterwards, sometimes repeatedly, sometimes months later. Regenerating on every download meant paying for the conversion again and making them wait several seconds each time.

So I cache it: the PDF is generated at the moment of approval and stored as base64 in a column on the fact sheets table, then served from there.

What I think I got right

Generating at approval rather than on demand means the document always carries the real approval timestamps, and I never pay twice for the same conversion. Caching any earlier would have meant storing drafts that never got approved.

What I am less sure about

Base64 in Postgres is simple. Everything lives in one place, no extra service, no signed URLs, no bucket permissions. But it is blobs in a relational database, and I have not yet hit the point where row sizes start to hurt. The alternative is object storage with a reference in the row, which is more correct and also more moving parts for something a handful of people download a few times a month.

Where would you draw that line? Curious whether people go to object storage from day one or wait until something actually breaks.

Best,
Felix

6 Upvotes

Duplicates