Subject | RE: [firebird-support] big images in database |
---|---|
Author | Alan McDonald |
Post date | 2009-07-18T03:01:23Z |
> Hello, I need to store some images in my FB2.1 database. I have asegment size is 80 by default and AFAIK it's meaningless anyway. just leave
> domain:
>
> CREATE DOMAIN IMAGEN AS
> BLOB SUB_TYPE 0 SEGMENT SIZE 100;
it at 80
>I would recommend you think long and hard about this before you start
> My question is; Is here any practical problem in storing, let's say,
> 3Mb images
> in blob fields in the database? I ask this because I'm thinking in
> creating a
> special folder inside my app folder, put the images there and in the
> datase just
> save the path to the images. Does it make sense?
>
> The images will be attached to production orders, therefore the table
> containing
> the images will grow with time. It can receive more than 50 orders a
> day with 3
> or 4 images each. Probably this is not too much for a database!! Any
> comment
> will be very appreciated!
>
> -sergio
storing images in your DB.
If you really must, I'd recommend you store one image per blob and not
multiple images in each blob. Set some kind of way to test and therefore
limit the size of the image on the client side (i.e. reject if too big) and
do some calculations on the size of images x the number per order x the
number of orders so you can see what imapct you will have on your DB.
Remember what this means to you backup/restore maintenance cycle and how you
eventually move backups around (off disk). You may regret this in the end.
And if you do now or ever wish to replicate, then that's a lot of bandwidht
and will always slow this down to something unpleasant.
Finally, if you must offer this, do some research on runtime filters so you
can zip the images before you post them and unzip them when you retrieve
them. This all depends on your client connectivity layer as well.
Alan