Subject | Re: [firebird-support] Best practices for saving product images in blobs in DB |
---|---|
Author | Lester Caine |
Post date | 2010-08-11T06:35:15Z |
Tommi Prami wrote:
images of any size that will grow to be a big beast, and should you need to
restore a backup it may take some time.
I used to think that this was the way to go, but I think I have now been
convinced otherwise. The question SHOULD be one of how do you use the images? In
my own case I need the images displayed in different sizes so do you simply send
a big picture and resize in the browser, or resize on the fly, or simplest ...
build a set of thumbnails when you save the image. And at this point I can also
generate thumbnails for pdf's and OO documents, and videos. Should you store all
the thumbnails in the database as well? Well if you store them, then
you have to extract them every time you need them, and Apache is much more
efficient simply pulling them direct from the file system ... isn't it?
Yes you have the problem of backing up the file system, but that is simply not a
problem nowadays, although THAT may be a candidate for a second database with
blobs of all the raw content. But with facilities like rsync, direct backup
options are already on the shelf.
--
Lester Caine - G8HFL
-----------------------------
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk//
Firebird - http://www.firebirdsql.org/index.php
> What arguments (pros/cons) there are for storing image data into DB?The pros are mainly that you have a single file to backup and maintain, but with
images of any size that will grow to be a big beast, and should you need to
restore a backup it may take some time.
I used to think that this was the way to go, but I think I have now been
convinced otherwise. The question SHOULD be one of how do you use the images? In
my own case I need the images displayed in different sizes so do you simply send
a big picture and resize in the browser, or resize on the fly, or simplest ...
build a set of thumbnails when you save the image. And at this point I can also
generate thumbnails for pdf's and OO documents, and videos. Should you store all
the thumbnails in the database as well? Well if you store them, then
you have to extract them every time you need them, and Apache is much more
efficient simply pulling them direct from the file system ... isn't it?
Yes you have the problem of backing up the file system, but that is simply not a
problem nowadays, although THAT may be a candidate for a second database with
blobs of all the raw content. But with facilities like rsync, direct backup
options are already on the shelf.
--
Lester Caine - G8HFL
-----------------------------
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk//
Firebird - http://www.firebirdsql.org/index.php