Save images in database or file system?

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
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.
File systems are databases optimized for storage of indexed large byte arrays.
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.

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