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