Can anybody suggest me which option is better to save image? We have 2 options: 1. Save image in a folder on our server. 2. Save image in database in binary format. why?
Purpose for saving image??? It could be anything. It could be saving members photo. products photo anything. And size we cant decide. One of my website is having more than 10gb Images.
It doesn't matter. Serving images from a folder will be faster, but sometimes it's easier to store them in the db if you're running a huge site where images are user-contributed.
storing the images in the database will be a option because storing in server will take large amount of space and make it slower.
File system only. With proper configuration it will only take one request to the HTTP server (which may be something lightweight like nginx or lighttpd) to retrieve an image. If you serve it from the database it takes one apache process, one php call, one call to mysql to say the least. HUGE waste of resources.
One thing I would like to inform you all. I did one simple test. In that I saved 5 images on server which occupied around 200 MB space while the same images on database occupied 40% less than storing it on server folder.