Search Postgresql Archives

Re: Database versus filesystem for storing images

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
said:
> "Jeremy Haile" <jhaile@xxxxxxxxxxx> 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@xxxxxxxxx>


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux