17.07.2015 Views

The Art of SQL Server FILESTREAM - Red Gate Software

The Art of SQL Server FILESTREAM - Red Gate Software

The Art of SQL Server FILESTREAM - Red Gate Software

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 1: Storing and Managing Unstructured DataConversely, if an application needs to store a PDF version <strong>of</strong> every quote sent to acustomer, then there is tighter coupling and it may make more sense to store the LOBs inthe database.Regardless <strong>of</strong> the route that seems most appropriate for your application, there are advantagesand disadvantages to each approach, based on considerations <strong>of</strong>:• transactional consistency• data manageability and recoverability• security• performance.We'll briefly discuss these issues in the coming sections, and further details can befound in Paul Randal's white paper, <strong>FILESTREAM</strong> Storage in <strong>SQL</strong> <strong>Server</strong> 2008(http://brurl.com/fs1).Transactional consistencyOne <strong>of</strong> the fundamental advantages <strong>of</strong> storing data in a relational database is that, viathe implementation <strong>of</strong> various transaction isolation levels, locking mechanisms, and soon, the relational engine guarantees a transactionally-consistent view <strong>of</strong> the data, at anypoint in time. In other words, it guarantees that transactions within <strong>SQL</strong> <strong>Server</strong> conformto the ACID properties, and so prevents interference between transactions on the samedata, and ensures that transactional operations can succeed or fail together, as a batch.By storing LOBs within the database, we can ensure that this transactional consistencyextends to the LOB data as well as other relational data within the database. For example,assume that a user uploads a document (a BLOB) into a document management applicationthat uses <strong>SQL</strong> <strong>Server</strong> storage. <strong>The</strong> operation involves inserting a new row into atable along with the relational data (such as the document name) and the BLOB data (the33

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!