Database or File System
Web applications often have graphics associated with tabular data. For example, real estate Web sites typically include photographs of homes for sale. On company intranet sites, client databases can contain image files of client products. For such applications, a common design question involves whether the images should be stored in the database or in a file system. In most cases, the best choice is to store the images in the database together with the other data.
Storing the images in a database is the better choice if the application in which the images will be used count on the benefits of a database system. The benefits of storing the images in the database include: •
Scalability. Although file systems are designed to handle a large number of objects of varying sizes, file systems usually are not optimized for a huge number (tens of millions) of small files. Database systems are optimized for such cases.
Availability. SQL Server has availability features that extend beyond those provided by the file system. •
SQL Server replication is a set of solutions that allow you to copy, distribute, and potentially modify data in a distributed environment.
•
Log shipping provides a way of keeping a stand-by copy of a database in case the primary system fails.
Storing images in a file system would be a better choice if: •
The application in which the images will be used requires streaming performance, such as real-time video playback.
•
BLOBs require frequentaccess by applications, such as Microsoft PhotoDraw® or Adobe Photoshop, which only know how to access files.
•
You want to use some specific feature in the NTFS file system such as Remote Storage.
As with most guidelines though, these points can assist in decision making only after a thorough research of the specific use, environment, and purpose of the application.