Re: pdf saving into DB vs. saving file location ?

From: Vick Khera <vivek(at)khera(dot)org>
To: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: pdf saving into DB vs. saving file location ?
Date: 2011-03-23 20:30:11
Message-ID: AANLkTikBG9N9MNK+8YD8VWENQ08RYeJkqE-22DZBn3kz@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, Mar 23, 2011 at 4:01 PM, Emi Lu <emilu(at)encs(dot)concordia(dot)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.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2011-03-23 21:05:42 Re: Understanding Datum
Previous Message Nick Raj 2011-03-23 20:19:54 Re: Understanding Datum