Re: images in database?

From: J.O. Aho <user_at_example.net>
Date: Mon, 6 Jun 2016 18:53:41 +0200
Message-ID: <drlo4lFenh6U1_at_mid.individual.net>


On 06/06/2016 04:03 PM, Jerry Stuckle wrote:
> On 6/6/2016 8:43 AM, mike7411_at_gmail.com wrote:
>> I’m working on an advertising network.
>>
>> Is it better to store the banners in the database or on the file system?
>
> There are advantages and disadvantages to both. I like to store images
> related to a page in a database. It helps maintain integrity - you
> won't accidentally delete an image if you use the INNODB engine and set
> up your referential integrity (foreign keys) properly.
>
> OTOH, if you're storing the images in the database, you'll need a script
> to do the retrieval - you can't just do it in html. However, this can
> also be advantageous because you can better control access to the images
> (I've had other sites link to my images without my permissions before -
> running up my bandwidth).
>
> Some people will say that images don't belong in a database. But when
> you get right down to it, a file system is just a different kind of
> database.

Sure, but the file system seldom runs inside another file system and a database seldom handles directly with the block device, so could make things slower.

But in the end it's just question about what solves the issue best.

-- 

 //Aho
Received on Mon Jun 06 2016 - 18:53:41 CEST

Original text of this message