General discussion


store image files in MySQL or flat file

By ang ·

I want to compare 2 image storage systems, one in MySQL and one in a flat file format:-

1) performance

As I read some articles / forums that someone says if the image stored in MySQL to be retreive more faster than stored in a flat file and someone have different ideas.

2) backup

Someone said it is easiler to backup the image files stored in a flat file than stored in MySQL database.

3) security

I would like to hear more about the 3 points that I pointed out since I will install the shopping cart in my website. Once I select the image storage method, then I cannot return it back.

Pleaes give advise.

Thanks a lot.


Andy Ng

This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Comments

Collapse -

by Jaqui In reply to store image files in MySQ ...

1) the db performance takes a hit when you store the images in it.
they increase th size for no gain.
just store the path to the images.

2) to backup the db, you need to be able to pull a copy of the sql file or else, dump contents to a file with full inserts.
if you do not have that access then you can't backup anything in the db.
( unlikley, hosting companies do give that access )

3) images will be copied of people want them. there is no 100% effective means to stop it.
there is no risk to site security by having images in the site space instead of the db, the space should not be world writable anyways.

Collapse -

by Jaqui In reply to

there are a few methods to interfere with downloading images from sites.

javascript based methods are useless, all that needs to be done is turn javascript off and security broken.

best method:
slice image and set as background in table.
in forground, place a transparent gif.
when people try to save, they get the gif.
if they get the backgrounds, then they have to re-assemble the image correctly to be able to use it.

Related Discussions

Related Forums