I’m working on an ASP.NET web app, this web site is hosted on a VDS (virtual dedicated server) which has a big hard drive (30 GB). Users can upload pictures and currently images are stored in database image columns (SQL server 2008). Is it better to store images as files on hard drive instead of saving them in database? what are pros and cons of each method? I think there would be about 100 pictures each day so I suppose database will grow quickly and finally I’ll have a really big MDF file!
Share
It depends on your priorities. There is no blanket answer for which method is the best. However, unless you foresee the need to utilize database backups for these images, storing pointers to the file-system should be adequate. Otherwise, the filestream option is best for storing images in a database.
PinalDave wrote on this subject and you may find the discussion interesting:
http://blog.sqlauthority.com/2009/07/13/sql-server-blob-pointer-to-image-image-in-database-filestream-storage/