On Wed, Mar 23, 2011 at 4:01 PM, Emi Lu <emilu@encs.concordia.ca> wrote:
> A question about saving PDF (size around 160kb) into postgresql large object
> columns vs. saving into a directory.
>
> May I know the performance differences? Pros and crons please?
>
> Each year, 20 new pdfs will be saved into DB (each around 160KB).
>
Just store them in bytea fields. No need for large objects at all.
We store images this way, and put a CDN in front of the web server
that pulls them from the DB, so the DB is rarely hit for such things.
The benefit of having everything managed within a single transaction
to the DB is worth the complexity of having the CDN.
Seeing as you only have about 20 per year, that's just a no-brainer to
store them in the DB.