Re: use BLOBS or use pointers to files on the filesystem?

From: Frank Joerdens <frank(at)archi-me-des(dot)de>
To: Travis Bear <ec9098(at)www2(dot)us(dot)postgresql(dot)org>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: use BLOBS or use pointers to files on the filesystem?
Date: 2001-12-10 16:09:46
Message-ID: 20011210170946.C24445@superfly.archi-me-des.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Sun, Dec 09, 2001 at 11:49:29PM +0000, Travis Bear wrote:
> Hi
>
> I'm kind of a database newbie in general, so be nice to me if this
> is a bonehead question. I am building a java servlet based web
> application to manage photos and images. My first thougth has been
> to store the images as BLOBs in the database, but I read one user say
> that you're better off not using BLOBs. Instead, he says, store your
> large data objects as files on the filesystem, and just use the
> database to store the path to the file and any file-related meta
> data.

Compared to retrieving stuff directly from the database, this would be
significantly faster. You could use a caching mechanism though to make
that disadvantage go away (have a look at www.phpbuilder.com for
examples on how to do that in PHP - which you might draw upon for your
Java solution).

The downside of having information in the filesystem (your images), and
meta-information about it in the database (the path to the images etc.)
is that you have to work much harder to make your application detect and
fix concurrency issues: If any other application besides your Servlet
can access the filesystem (which is pretty normal), those others might
modify it without modifying the database. Then you have a filesystem out
of sync with the database. Once you have that problem, it would be hard
to recover from. (Could anyone explain that better? I can't seem to
find the right words to make it really clear.)

I prefer BLOBs + Caching.

Regards, Frank

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Troy.Campano 2001-12-10 16:17:42 Re: use BLOBS or use pointers to files on the filesyste
Previous Message Raul DAVIDOVICH 2001-12-10 16:07:03 problem with select after updating