You are a database developer. You plan to design a database solution by using SQL Server 2008. A table in a database will store large image files (20-50 MB in size). You have the following business requirements:
* The image files are accessible by applications that use Win32 APIs.
* The image files are part of the database backup.
You need to identify an appropriate strategy to store the image files. Which strategy should you use?
A.
Use an image data type.
B.
Use the varbinary(max) data type.
C.
Use the varbinary(max) data type along with the FILESTREAM attribute.
D.
Store the image file in a file system. Use a varchar data type to store the file location in the database.
Explanation:
In SQL Server, BLOBs can be standard varbinary(max) data that stores the data in tables, or FILESTREAM varbinary(max) objects that store the data in the file system. The size and use of the data determines whether you should use database storage or file system storage. If the following conditions are true, you should consider using FILESTREAM:
– Objects that are being stored are, on average, larger than 1 MB.
– Fast read access is important.
– You are developing applications that use a middle tier for application logic.For smaller objects, storing varbinary(max) BLOBs in the database often provides better streaming performance.