Save images in database or file system?

Aug 22, 2014 at 3:49pm
I need help for which is best option to save images in database or file system,
I am developing c++ server client app. I want to save the images in server using file system or database. I am confusing to choose which option?
Last edited on Aug 22, 2014 at 3:49pm
Aug 22, 2014 at 6:19pm
You can store images in a database, but people usually just store them on a filesystem, and the database stores the path to that image.
Aug 22, 2014 at 6:23pm
File systems are databases optimized for storage of indexed large byte arrays.
Aug 22, 2014 at 7:21pm
How will you be accessing the images?
How will you manage them? A file system makes it easy to drop in, view the images, add or delete individual ones etc. Is that good or bad for your application?

Note that you can always do both: a database with all the lookup fields you want and one extra field that is the path to the image data itself.

Aug 23, 2014 at 4:22am
If i am using file system, the large number of file handling will problem occur. If i am using database, the database cost is high and if database corrupt what i do>
Aug 23, 2014 at 1:48pm
Those are important considerations. What are the other things you will do with the images? How will you look them up? What will you do with the images once they are found? How many people will access them? Can you allow simultaneous access?

Most of what I've listed are performance considerations. Do they even matter? Or will the load be low enough that either will do? In that case, considerations like manageability and recoverability will be more important.

Also, consider a 3rd party. I use thumbs plus at home. It stores a thumbnail and meta data about each image in a database. I'm almost certain that you access it programatically. Something like that might work for you too.
Topic archived. No new replies allowed.