Re: images in database?

From: Jerry Stuckle <jstucklex_at_attglobal.net>
Date: Mon, 6 Jun 2016 10:03:37 -0400
Message-ID: <nj3vrp$3r9$1_at_jstuckle.eternal-september.org>


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?
>
> Thank you.
>

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.

It's all in how you want to handle it.

-- 
==================
Remove the "x" from my email address
Jerry Stuckle
jstucklex_at_attglobal.net
==================
Received on Mon Jun 06 2016 - 16:03:37 CEST

Original text of this message