
Therefore, FILESTREAM provides caching at the system cache providing performance benefits without affecting core SQL Server performance.Įnabling the FILESTREAM feature in SQL Server If we cache these large objects in the SQL Server memory, it will cause issues for normal database processing.

One more advantage of the FILESTREAM is that it does not use the buffer pool memory for caching these objects. You can perform actions on the documents using the SQL Server database itself. In the above illustration, you can see the documents are stored in the file system, and the database has a particular filegroup ‘FILESTREAM’. Now let us look at the changes in this example using the SQL Server FILESTREAM feature. Let us understand the difference in storing the images in the database or the file system using SQL Server FILESTREAM.īelow you can traditional database storing the employee photo in the database itself. It looks similar to the data stored in a traditional database. When we access the documents that are stored in the file system using the FILESTREAM, we do not notice any changes in accessing it. It allows SQL Server to store the data in the file system for these data type. We need to define a table having varbinary(max) column with the FILESTREAM attribute. In SQL Server FILESTREAM, We need to define a new filegroup ‘FILESTREAM’. Traditionally if we store the data in the BLOB data type, it is stored in the Primary file group only.

Note: FILESTREAM is not a SQL Server data type to store data Therefore, we get the performance benefit of this streaming API as well while accessing these documents. SQL Server or other applications can access these files using the NTFS streaming API. We can store large size documents as per the underlying file system limitation. In FILESTREAM, we do not have a limit of storage up to 2 GB, unlike the BLOB data type. This kind of data also slow down the performance of your database system since it tends to be large and takes significant system resources to bring it back from the disk.įILESTREAM, in SQL Server, allows storing these large documents, images or files onto the file system itself. You might have seen people using BLOB data to store these kinds of data, but you can save only up to 2 GB using this. This data may be in multiple forms such as a document, images, audio or video files. We may need to store a different kind of data in our SQL Server database apart from the regular table-based data. This article will discuss SQL Server FILESTREAM including installation, configuration, enabling and general considerations.
