Re: PDF files: to store in database or not

From: John DeSoi <desoi(at)pgedit(dot)com>
To: Eric Schwarzenbach <subscriber(at)blackbrook(dot)org>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: PDF files: to store in database or not
Date: 2016-12-08 14:11:01
Message-ID: 75E5475B-0D48-427F-B623-1DA3873B5F41@pgedit.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


> On Dec 6, 2016, at 1:09 PM, Eric Schwarzenbach <subscriber(at)blackbrook(dot)org> wrote:
>
> I've often wondered if we'd have been better off storing the files in the database. This design decision was made some years ago, and our concerns around this had to do with performance, but I don't know that we had any real data that this should have been a concern, and I suspect you could ameliorate if not eliminate this as an issue by careful design. I'd loved to hear this idea confirmed or debunked by someone who has more expertise (and ideally, done actual testing).

I have been storing PDFs in Postgres for several years without any problems. Documents range in size from a few pages to 100+ pages. I'm using a bytea column, not large objects. I store the documents in a separate database from the rest of the application data in order to make it easy to exclude in database dumps or backup in some other way. I'm currently managing about 600,000 documents.

I created some functions that enable a subset of the document database to be synchronized elsewhere. For example, we need to keep only the last 3 years of documents on a website for user access. Using Postgres has made this easy to manage and verify. And with replication we automatically have the document database available on the backup web server without additional effort.

John DeSoi, Ph.D.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2016-12-08 14:47:24 Re: Importing SQLite database
Previous Message William Ivanski 2016-12-08 13:40:41 Re: Importing SQLite database