Re: Database versus filesystem for storing images

From: "Jeremy Haile" <jhaile(at)fastmail(dot)fm>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Database versus filesystem for storing images
Date: 2007-01-05 23:07:21
Message-ID: 1168038441.20812.283358879@webmail.messagingengine.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Referential integrity would be one positive for storing the files in the
database. I wasn't responding to that. I'm simply saying that browsing
them with third-party tools, updating, compressing/archiving, etc. is
easier if they are not in the database. Those are all actions that I've
found useful on other projects when storing user-uploaded images.

Depending upon the number of images on disk, it might not be hard to
verify that all the images referenced from the DB are there. You could
have a small program that steps through each record and verifies its
existence on disk. That could easily be run after a restore or as a
batch-process. If you're talking about trillions of images - sure
that'd be tough. If these images are extremely important - maybe that
solution is unacceptable. But this is just a case of too little
information to make a decision.

There are pros and cons to both approach - in every project I've worked
on that faced this decision, I felt the pros of storing it in the file
system outweighed the pros of storing it in the DB. But there is no
right or wrong answer to the question (unless of course you had special
circumstances that made one option clearly superior - but I don't think
we know enough details to make that call)

My two cents,
Jeremy Haile

On Fri, 05 Jan 2007 20:24:05 -0200, "Jorge Godoy" <jgodoy(at)gmail(dot)com>
said:
> "Jeremy Haile" <jhaile(at)fastmail(dot)fm> writes:
>
> > Another thing to consider is that storing them in the file system makes
> > it much easier to browse the images using third-party tools, update
> > them, archive them (by gzipping or whatever). This is much more
> > difficult if they are stored in the database.
>
> If you touch the files with third-party tools how are you going to
> prevent
> that they aren't missing when the database say they are there? If you're
> referencing them somehow, you have to guarantee that they are there...
> Or am
> I the only one that is thinking about referential integrity with those
> files?
>
> --
> Jorge Godoy <jgodoy(at)gmail(dot)com>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Ragnar 2007-01-05 23:24:24 Re: Database versus filesystem for storing images
Previous Message Curran Schiefelbein 2007-01-05 23:05:19 configure; make on cygwin doesn't produce DLLs