Jump to content

to store images in mysql db or not that is the question


kate_rose

Recommended Posts

I was wondering what the advantages are of storing images in a mysql data base versus retrieving images stored on the server.

Which is better?

 

My application:  I am developing a web browser based plant ID system that I want to run on & off-line.  It will be heavily reliant on images.  I am planning to create a CD with all my images for offline use & I will probably include wampserver so in can be run offline.  I could alternatively store those images in mysql.  I have heard that mysql retrieval of images takes longer.  Does it take a lot longer??  If I have a lot of images would it significantly affect their load time?

 

I also want my users to be able to upload & save their photos for comparison purposes.  I want the database to be dynamic in that the user could add to or shape the visual elements of the ID system.  I also want to be able to update it as I acquire new images & add plants.

I have also heard that mysql is better for user upload because of complications with the paths.  True??

 

I would love to hear your opinions & any info you have to share.

 

Thanks,

 

Kate

 

 

About the only advantage I can think of for storing an image (or any other file) in a database is if you want that image/file to be accessible to more than one web site or more than one web server. If an image/file is stored as a file in a folder, by default it is only accessible to the account that owns that folder, whereas a database would be or could be made accessible to multiple web sites or web servers.

 

Everything else about storing a file in a database is a disadvantage -

 

There is additional overhead just putting the file into a database and every time it is retrieved.

 

There is a database transfer packet size that will limit how big a file can be put into or retrieved in a single query.

 

It causes the database data file size to grow quickly, which makes backing up or moving the database harder because you must store and move a file that is the size of all the images that is in it. It is much easier and less error prone (and easier to recover from an error) to upload/download (ftp) multiple smaller files than a huge database dump/backup file.

So if I want multiple users to be able to use the id program on line at the same time I need to store them in the db??
No. I stated more than one web site. That does not mean more than one visitor to a single web site.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.