Re: pdf saving into DB vs. saving file location ? - Mailing list pgsql-general

From Vick Khera
Subject Re: pdf saving into DB vs. saving file location ?
Date
Msg-id AANLkTikBG9N9MNK+8YD8VWENQ08RYeJkqE-22DZBn3kz@mail.gmail.com
Whole thread Raw
In response to pdf saving into DB vs. saving file location ?  (Emi Lu <emilu@encs.concordia.ca>)
List pgsql-general
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.

pgsql-general by date:

Previous
From: Nick Raj
Date:
Subject: Re: Understanding Datum
Next
From: Tom Lane
Date:
Subject: Re: Understanding Datum