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

 

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.