SlideShare a Scribd company logo
1 of 22
File Stream
Microsoft SQL Server
       2008 R2
          Kobi Cohen
     System DBA Manager
       Spiral Solutions
Objectives
              Familiarization with FILESTREAM
                       Overview
                       Storage
                       Security & Access
                       Implementation
                       Application Considerations
                       Combined with other SQL Server features
                       Cluster Configuration
                       RBS (Remote BLOB store)



©Spiral Solutions, Ltd. All rights reserved.
File Stream
     Overview
              For unstructured data  docs, images, videos.
              not new data type  Storage attribute.
              Varbinary (max) only  Fully transactional.
              BLOBs saved on storage (NTFS file system)
                       Needs coordination between DBA and System Administrator.

              Can be accessed by T-SQL (DMLs) or Win32 API (stream access).
              Use NT system cache:
                       Much faster  Avoid double writing (Buffer cache + Disk).
                       Reduce load from DB engine.
                       SQL Server buffer pool isn’t used  more free memory.
                       BLOB size limited only by the volume size (not limited to 2GB)
                        even in Express Edition.
©Spiral Solutions, Ltd. All rights reserved.
File Stream
     Overview
              Store BLOBs in table? On separate files? or in FILESTREAM?
                       Data size 
                                Larger than 1 MB  NTFS FILESTREAM.
                                Smaller than 256 KB  inside the database.
                                Between 256 KB and 1MB  depend on read vs. write ratio + overwrite rate.

                       Performance  Fast read access is important NTFS FILESTREAM.
                       Transactional Consistency  BLOB + structured data  FILESTREAM.
                       Security  sensitive data  FILESTREAM  SQL security over ACLs.
                       Manageability  integrated solution  less complex  FILESTREAM.
                       Data fragmentation  frequent updates  easier to handle on NTFS.
                       Client access  Using DB access protocols (ODBC, OLEDB)  NTFS
                        FILESTREAM.

©Spiral Solutions, Ltd. All rights reserved.
File Stream
     Overview

                                           BLOB Storage Methods Comparison
                                                                                   Storage solution

                   Comparison point                                             SQL Server (using
                                                File server / file system                                    FILESTREAM
                                                                                 varbinary(max))

       Maximum BLOB size                        NTFS volume size            2 GB – 1 bytes            NTFS volume size


       Streaming performance of large
                                                Excellent                   Poor                      Excellent
       BLOBs

       Security                                 Manual ACLs                 Integrated                Integrated + automatic ACLs


       Cost per GB                              Low                         High                      Low


       Manageability                            Difficult                   Integrated                Integrated


       Integration with structured data         Difficult                   Data-level consistency    Data-level consistency

       Application development and
                                                More complex                More simple               More simple
       deployment

       Recovery from data fragmentation         Excellent                   Poor                      Excellent


       Performance of frequent small
                                                Excellent                   Moderate                  Poor
       updates



©Spiral Solutions, Ltd. All rights reserved.
File Stream
     Overview

                     Read Performance Comparison (Cold buffer pool)




©Spiral Solutions, Ltd. All rights reserved.
File Stream
     Overview

                   Read Performance Comparison (Warm buffer pool)




©Spiral Solutions, Ltd. All rights reserved.
File Stream
     Overview

                    Insert Performance Comparison (Cold buffer pool)




©Spiral Solutions, Ltd. All rights reserved.
File Stream
     Overview

                  Update Performance Comparison (Cold buffer pool)




©Spiral Solutions, Ltd. All rights reserved.
File Stream
     Storage
              Preparing for FILESTREAM:
                       Set the proper Disk/RAID level  resilience, performance, cost, load.
                       Use FSUTIL :
                                 Turn off short (8.3) file names.
                                 Disable last access time.
                                 Format volume cluster size  Use 64-KB NTFS clusters  4-KB for
                                  compressed volumes.
                                 Compress volume  extra CPU.

                       Regularly defrag FILESTREAM computer systems.
                       Set antivirus scan of FILESTREAM volumes to avoid delete
                        infected files  quarantine if it’s a must.




©Spiral Solutions, Ltd. All rights reserved.
File Stream
     Storage
              FILESTREAM stored in special file groups:
                       File system filter per each volume  one for SQL Server
                        version  Integrated security is a must.
                       File system directories (data containers)
                        instead of data files (mdf, ndf).
                       FILESTREAM file group = FILESTREAM data container.
                       Adding file to FILESTREAM file group = define data container:
                                Each logical file name is the root directory name.
                                Filestream.hdr  FILESTREAM metadata describing data container.
                                $FSLOG  FILESTREM equivalent to transaction log.

                       FILESTREAM operation  mapped to LSN.
                                FILESTREAM garbage collection thread  triggered by CHECKPOINT.

                       DBCC CHECKDB  for validates link-level consistency.
©Spiral Solutions, Ltd. All rights reserved.
File Stream
     Storage
              File stream storage considerations:
                       Separate FILESTREAM data containers from:
                                OS volumes and paging file volumes.
                                Tempdb volumes.
                                Databases data & log files volumes.

                       Each data container on separate volume  granular control.
                       Data containers cannot be nested.
                       All FILSTREAM columns data in a table must be stored in same
                        FILESTREAM file group  FILESTREAM_ON better performance.
                       Each row must have non-null unique row id (uniqueidentifier
                        ROWGUID) and a unique/primary key index (clustered only for
                        non-random data to avoid index reordering on every insert/delete).
                       Can use partitioning on uniqueidentifier column for load balancing.
©Spiral Solutions, Ltd. All rights reserved.
File Stream
     Security & Access
              FILESTREAM is secured like other data:
                       GRANT permission on DB, schema, table or column.
                       NTFS permissions (ACLs) are ignored.

              Only SQL Server service account is granted NTFS access to data
               containers to avoid outside data editing.
              Requires integrated security (Windows authentication) 
               Windows token  pass client identity in file I/O operation.
              Support snapshot isolation level (only in 2008 R2).
              Remote access By Server Message Block (SMB) protocol.
              Firewall considerations:
                       Enable both client & server to resolve DNS names.
                       Open file-sharing TCP ports: 139, 445 (for remote access).
©Spiral Solutions, Ltd. All rights reserved.
File Stream
     Security & Access
              Dual programing model to access BLOBs:
                       T-SQL for DMLs:
                                  Insert  can be used with null value, empty (‘’) value or short inline data.
                                Update  if FILESTREAM field is set to null, the related BLOB is deleted.
                                 Partial field update can’t be done with T-SQL (use UPDATE.Write()) since
                                 update = create new copy of FILESTREAM data file + delete old file.
                                 Partial update only by: FSCTL_SQL_FILESTREAM_FETCH_OLD_CONTENT
                                Delete or Truncate  underlined BLOB data is deleted in file system.

                       File system streaming access (for read & write):
                                Statement model  models T-SQL statements by using open & close
                                 methods  File handle is live in that scope  open handle = open
                                 transaction.
                                Storage namespace  DB engine controls BLOB physical file  new
                                 internal function column_name.PathName(@option) used by API to provide
                                 the logical UNC path of the BLOB to get the Win32 handle.
©Spiral Solutions, Ltd. All rights reserved.
File Stream
     Security & Access
                                Transacted file system access  New function provides token for current
                                 session’s transaction GET_FILESTREAM_TRANSACTION_CONTEXT () 
                                 binds file streaming operations with a started transaction.
                                 Return NULL if there is no explicitly started transaction.
                                In C++/ODBC  SQL Native Client 10  OpenSqlFilestream  Win32 handle.
                                In C#  .NET Framework 3.5 SP1  SqlFileStream Data Type  path name +
                                 transaction token  handle can be passed to Win32 File API.
                                Write-through from remote client  No write operation are cached on client
                                 side  better to make fewer writes with larger data size.




©Spiral Solutions, Ltd. All rights reserved.
File Stream
     Demo




                                               Demo


©Spiral Solutions, Ltd. All rights reserved.
File Stream
     Application Considerations
              Use NULL instead of 0x for non-initialized FILESTREAM
               column to avoid file creation.
              Avoid insert & update in tables with NOT NULL FILESTREAM
               columns  decrease application performance over time.
              In replication  use NEWSEQUENTIALID() instead of NEWID() 
               for better performance.
              Avoid T-SQL for update, append, prepend data to FILESTREAM
               BLOB  will be spooled into tempdb.
              Avoid appending small BLOB updates  Causes FILESTREAM
               files to be copied  Write BLOB into varbinary(max) parameter
               and do single write operation.
              Avoid getting lots of BLOB files length in application use
               DATALENGTH() in T-SQL  does not open the BLOB.
©Spiral Solutions, Ltd. All rights reserved.
File Stream
     Combined with other features
              Snapshots  Only by excluding FILESTREAM file groups 
               FILESTREAM file groups will be marked as offline.

              Replication Supported by both transactional & merge
               with many considerations  SQL 2008 or later on all subscribers.
              Log Shipping  supports FILESTREAM.
              Mirroring  Does not support FILESTREAM.
              Clustering  fully supported. Must enable FILESTREAM on all nodes
              Backup & Restore  Fully supported on all recovery models.
              Encryption  is not supported even when TDE is enabled.
              Indexes  cannot be a part of: index key / include column / statistics.
              Constraints (PK,FK,UQ) cannot be created on FILESTREAM column.
              Temp tables & TVP  cannot be used in local/global temp tables & TVP.

©Spiral Solutions, Ltd. All rights reserved.
File Stream
     Cluster Configuration
              Data containers must be on shared disk resource.
              Separate LUN for FILESTREAM is recommended.
              Steps for enabling FILESTREAM:
                       Enable file stream on service level  on all nodes.
                                Windows Share Name must be the same on all nodes.
                                Allow remote clients access  create a file-share cluster resource.

                       Enable file stream on instance level (facets)  on all nodes.
                       Add dependency of FILESTREAM LUN to SQL Service.
                       Take SQL Service off & Bring SQL Service + dependencies on.

              NetApp Snap Manager requirements:
                       Separate LUNs to data files, Log files & FILESTREAM files.


©Spiral Solutions, Ltd. All rights reserved.
File Stream
     RBS
              Complementary approach  store BLOBs on remote storage.
              Provided with SQL Server 2008 R2 Feature pack.
              library API set  moving BLOBs from MS SQL to external storage.
              Set of SPs and SDK  RBS provider for File stream.
                       Client-side DLL linked into a user application + stored procedures on
                        SQL Server.




©Spiral Solutions, Ltd. All rights reserved.
File Stream
     Useful Links
              FILESTREAM Storage in SQL Server 2008:
               http://msdn.microsoft.com/en-us/library/cc949109(v=sql.100).aspx

              To BLOB or Not To BLOB - Large Object Storage in a Database or
               a File system:
               http://research.microsoft.com/apps/pubs/default.aspx?id=64525

              How to enable FILESTREAM from the command line:
               http://sqlsrvengine.codeplex.com/wikipage?title=FileStreamEnable&referri
               ngTitle=Home&ProjectName=sqlsrvengine

              FSUTIL syntax:
               http://technet.microsoft.com/en-us/library/cc785435(v=ws.10).aspx

              SQL Server 2008 R2 Remote Blob Store (RBS) Download :
               http://www.microsoft.com/download/en/confirmation.aspx?id=16978


©Spiral Solutions, Ltd. All rights reserved.
File Stream
     End




                                               Thanks


©Spiral Solutions, Ltd. All rights reserved.

More Related Content

What's hot

Distribution File System DFS Technologies
Distribution File System DFS TechnologiesDistribution File System DFS Technologies
Distribution File System DFS TechnologiesRaphael Ejike
 
Acyclic grapch directory 56(2)
Acyclic grapch directory 56(2)Acyclic grapch directory 56(2)
Acyclic grapch directory 56(2)myrajendra
 
Hadoop Distributed File System
Hadoop Distributed File SystemHadoop Distributed File System
Hadoop Distributed File SystemMilad Sobhkhiz
 
11 distributed file_systems
11 distributed file_systems11 distributed file_systems
11 distributed file_systemslongly
 
Distributed Filesystems Review
Distributed Filesystems ReviewDistributed Filesystems Review
Distributed Filesystems ReviewSchubert Zhang
 
Operational foundation for the sql server dba
Operational foundation for the sql server dbaOperational foundation for the sql server dba
Operational foundation for the sql server dbaPeterShore4
 
File models and file accessing models
File models and file accessing modelsFile models and file accessing models
File models and file accessing modelsishmecse13
 
Examining Linux File Structures
Examining Linux File StructuresExamining Linux File Structures
Examining Linux File Structuresprimeteacher32
 
Using oracle12c pluggable databases to archive
Using oracle12c pluggable databases to archiveUsing oracle12c pluggable databases to archive
Using oracle12c pluggable databases to archiveSecure-24
 
Active directory
Active directory Active directory
Active directory deshvikas
 
File Directory Structure-R.D.Sivakumar
File Directory Structure-R.D.SivakumarFile Directory Structure-R.D.Sivakumar
File Directory Structure-R.D.SivakumarSivakumar R D .
 
Oracle architecture
Oracle architectureOracle architecture
Oracle architectureSoumya Das
 

What's hot (20)

Distribution File System DFS Technologies
Distribution File System DFS TechnologiesDistribution File System DFS Technologies
Distribution File System DFS Technologies
 
Acyclic grapch directory 56(2)
Acyclic grapch directory 56(2)Acyclic grapch directory 56(2)
Acyclic grapch directory 56(2)
 
Hadoop Distributed File System
Hadoop Distributed File SystemHadoop Distributed File System
Hadoop Distributed File System
 
11 distributed file_systems
11 distributed file_systems11 distributed file_systems
11 distributed file_systems
 
file management
file managementfile management
file management
 
Distributed Filesystems Review
Distributed Filesystems ReviewDistributed Filesystems Review
Distributed Filesystems Review
 
Operational foundation for the sql server dba
Operational foundation for the sql server dbaOperational foundation for the sql server dba
Operational foundation for the sql server dba
 
Presentation day1oracle 12c
Presentation day1oracle 12cPresentation day1oracle 12c
Presentation day1oracle 12c
 
Mysql database
Mysql databaseMysql database
Mysql database
 
File models and file accessing models
File models and file accessing modelsFile models and file accessing models
File models and file accessing models
 
Presentationday3oracle12c
Presentationday3oracle12cPresentationday3oracle12c
Presentationday3oracle12c
 
Examining Linux File Structures
Examining Linux File StructuresExamining Linux File Structures
Examining Linux File Structures
 
Using oracle12c pluggable databases to archive
Using oracle12c pluggable databases to archiveUsing oracle12c pluggable databases to archive
Using oracle12c pluggable databases to archive
 
File Management
File ManagementFile Management
File Management
 
Active directory
Active directory Active directory
Active directory
 
File Directory Structure-R.D.Sivakumar
File Directory Structure-R.D.SivakumarFile Directory Structure-R.D.Sivakumar
File Directory Structure-R.D.Sivakumar
 
Oracle 12c Architecture
Oracle 12c ArchitectureOracle 12c Architecture
Oracle 12c Architecture
 
11. dfs
11. dfs11. dfs
11. dfs
 
12. dfs
12. dfs12. dfs
12. dfs
 
Oracle architecture
Oracle architectureOracle architecture
Oracle architecture
 

Viewers also liked

Sql server 2012 transact sql dml reference
Sql server 2012 transact sql dml referenceSql server 2012 transact sql dml reference
Sql server 2012 transact sql dml referenceU.N.S.C
 
Sql server ___________session 1(sql 2008)
Sql server  ___________session 1(sql 2008)Sql server  ___________session 1(sql 2008)
Sql server ___________session 1(sql 2008)Ehtisham Ali
 
Intro to the New Data Types in SQL 2008
Intro to the New Data Types in SQL 2008Intro to the New Data Types in SQL 2008
Intro to the New Data Types in SQL 2008Sarah Dutkiewicz
 
Open text content lifecycle management 2010
Open text content lifecycle management 2010Open text content lifecycle management 2010
Open text content lifecycle management 2010Carlo M
 
Windows azure sql_database_security_isug012013
Windows azure sql_database_security_isug012013Windows azure sql_database_security_isug012013
Windows azure sql_database_security_isug012013sqlserver.co.il
 
10 Ways To Abuse T-SQL
10 Ways To Abuse T-SQL10 Ways To Abuse T-SQL
10 Ways To Abuse T-SQLTracy McKibben
 

Viewers also liked (6)

Sql server 2012 transact sql dml reference
Sql server 2012 transact sql dml referenceSql server 2012 transact sql dml reference
Sql server 2012 transact sql dml reference
 
Sql server ___________session 1(sql 2008)
Sql server  ___________session 1(sql 2008)Sql server  ___________session 1(sql 2008)
Sql server ___________session 1(sql 2008)
 
Intro to the New Data Types in SQL 2008
Intro to the New Data Types in SQL 2008Intro to the New Data Types in SQL 2008
Intro to the New Data Types in SQL 2008
 
Open text content lifecycle management 2010
Open text content lifecycle management 2010Open text content lifecycle management 2010
Open text content lifecycle management 2010
 
Windows azure sql_database_security_isug012013
Windows azure sql_database_security_isug012013Windows azure sql_database_security_isug012013
Windows azure sql_database_security_isug012013
 
10 Ways To Abuse T-SQL
10 Ways To Abuse T-SQL10 Ways To Abuse T-SQL
10 Ways To Abuse T-SQL
 

Similar to ISUG 113: File stream

AWS re:Invent 2016: Deep Dive on Amazon Elastic File System (STG202)
AWS re:Invent 2016: Deep Dive on Amazon Elastic File System (STG202)AWS re:Invent 2016: Deep Dive on Amazon Elastic File System (STG202)
AWS re:Invent 2016: Deep Dive on Amazon Elastic File System (STG202)Amazon Web Services
 
What is Object storage ?
What is Object storage ?What is Object storage ?
What is Object storage ?Nabil Kassi
 
SQLBits X SQL Server 2012 Rich Unstructured Data
SQLBits X SQL Server 2012 Rich Unstructured DataSQLBits X SQL Server 2012 Rich Unstructured Data
SQLBits X SQL Server 2012 Rich Unstructured DataMichael Rys
 
Btrfs: Design, Implementation and the Current Status
Btrfs: Design, Implementation and the Current StatusBtrfs: Design, Implementation and the Current Status
Btrfs: Design, Implementation and the Current StatusLukáš Czerner
 
002-Storage Basics and Application Environments V1.0.pptx
002-Storage Basics and Application Environments V1.0.pptx002-Storage Basics and Application Environments V1.0.pptx
002-Storage Basics and Application Environments V1.0.pptxDrewMe1
 
Webinar NETGEAR - ReadyNAS come File Server: condivisione, collaborazione e ...
Webinar NETGEAR - ReadyNAS come File Server:  condivisione, collaborazione e ...Webinar NETGEAR - ReadyNAS come File Server:  condivisione, collaborazione e ...
Webinar NETGEAR - ReadyNAS come File Server: condivisione, collaborazione e ...Netgear Italia
 
Dipping Your Toes: Azure Data Lake for DBAs
Dipping Your Toes: Azure Data Lake for DBAsDipping Your Toes: Azure Data Lake for DBAs
Dipping Your Toes: Azure Data Lake for DBAsBob Pusateri
 
Oracle & sql server comparison 2
Oracle & sql server comparison 2Oracle & sql server comparison 2
Oracle & sql server comparison 2Mohsen B
 
Deep Dive on Amazon Elastic File System - June 2017 AWS Online Tech Talks
Deep Dive on Amazon Elastic File System - June 2017 AWS Online Tech TalksDeep Dive on Amazon Elastic File System - June 2017 AWS Online Tech Talks
Deep Dive on Amazon Elastic File System - June 2017 AWS Online Tech TalksAmazon Web Services
 
Deep Dive on Elastic File System - February 2017 AWS Online Tech Talks
Deep Dive on Elastic File System - February 2017 AWS Online Tech TalksDeep Dive on Elastic File System - February 2017 AWS Online Tech Talks
Deep Dive on Elastic File System - February 2017 AWS Online Tech TalksAmazon Web Services
 
S ss0885 spectrum-scale-elastic-edge2015-v5
S ss0885 spectrum-scale-elastic-edge2015-v5S ss0885 spectrum-scale-elastic-edge2015-v5
S ss0885 spectrum-scale-elastic-edge2015-v5Tony Pearson
 
Elastic storage in the cloud session 5224 final v2
Elastic storage in the cloud session 5224 final v2Elastic storage in the cloud session 5224 final v2
Elastic storage in the cloud session 5224 final v2BradDesAulniers2
 
SRV401 Deep Dive on Amazon Elastic File System (Amazon EFS)
SRV401 Deep Dive on Amazon Elastic File System (Amazon EFS)SRV401 Deep Dive on Amazon Elastic File System (Amazon EFS)
SRV401 Deep Dive on Amazon Elastic File System (Amazon EFS)Amazon Web Services
 
Deep Dive on Amazon EFS | AWS Public Sector Summit 2017
Deep Dive on Amazon EFS | AWS Public Sector Summit 2017Deep Dive on Amazon EFS | AWS Public Sector Summit 2017
Deep Dive on Amazon EFS | AWS Public Sector Summit 2017Amazon Web Services
 
Ibm total storage san file system as an infrastructure for multimedia servers...
Ibm total storage san file system as an infrastructure for multimedia servers...Ibm total storage san file system as an infrastructure for multimedia servers...
Ibm total storage san file system as an infrastructure for multimedia servers...Banking at Ho Chi Minh city
 
Ibm total storage san file system as an infrastructure for multimedia servers...
Ibm total storage san file system as an infrastructure for multimedia servers...Ibm total storage san file system as an infrastructure for multimedia servers...
Ibm total storage san file system as an infrastructure for multimedia servers...Banking at Ho Chi Minh city
 
The Pendulum Swings Back: Converged and Hyperconverged Environments
The Pendulum Swings Back: Converged and Hyperconverged EnvironmentsThe Pendulum Swings Back: Converged and Hyperconverged Environments
The Pendulum Swings Back: Converged and Hyperconverged EnvironmentsTony Pearson
 
IBM Spectrum Scale for File and Object Storage
IBM Spectrum Scale for File and Object StorageIBM Spectrum Scale for File and Object Storage
IBM Spectrum Scale for File and Object StorageTony Pearson
 

Similar to ISUG 113: File stream (20)

AWS re:Invent 2016: Deep Dive on Amazon Elastic File System (STG202)
AWS re:Invent 2016: Deep Dive on Amazon Elastic File System (STG202)AWS re:Invent 2016: Deep Dive on Amazon Elastic File System (STG202)
AWS re:Invent 2016: Deep Dive on Amazon Elastic File System (STG202)
 
What is Object storage ?
What is Object storage ?What is Object storage ?
What is Object storage ?
 
SQLBits X SQL Server 2012 Rich Unstructured Data
SQLBits X SQL Server 2012 Rich Unstructured DataSQLBits X SQL Server 2012 Rich Unstructured Data
SQLBits X SQL Server 2012 Rich Unstructured Data
 
Btrfs: Design, Implementation and the Current Status
Btrfs: Design, Implementation and the Current StatusBtrfs: Design, Implementation and the Current Status
Btrfs: Design, Implementation and the Current Status
 
002-Storage Basics and Application Environments V1.0.pptx
002-Storage Basics and Application Environments V1.0.pptx002-Storage Basics and Application Environments V1.0.pptx
002-Storage Basics and Application Environments V1.0.pptx
 
Webinar NETGEAR - ReadyNAS come File Server: condivisione, collaborazione e ...
Webinar NETGEAR - ReadyNAS come File Server:  condivisione, collaborazione e ...Webinar NETGEAR - ReadyNAS come File Server:  condivisione, collaborazione e ...
Webinar NETGEAR - ReadyNAS come File Server: condivisione, collaborazione e ...
 
Dipping Your Toes: Azure Data Lake for DBAs
Dipping Your Toes: Azure Data Lake for DBAsDipping Your Toes: Azure Data Lake for DBAs
Dipping Your Toes: Azure Data Lake for DBAs
 
Oracle & sql server comparison 2
Oracle & sql server comparison 2Oracle & sql server comparison 2
Oracle & sql server comparison 2
 
Deep Dive on Amazon Elastic File System - June 2017 AWS Online Tech Talks
Deep Dive on Amazon Elastic File System - June 2017 AWS Online Tech TalksDeep Dive on Amazon Elastic File System - June 2017 AWS Online Tech Talks
Deep Dive on Amazon Elastic File System - June 2017 AWS Online Tech Talks
 
Deep Dive on Elastic File System - February 2017 AWS Online Tech Talks
Deep Dive on Elastic File System - February 2017 AWS Online Tech TalksDeep Dive on Elastic File System - February 2017 AWS Online Tech Talks
Deep Dive on Elastic File System - February 2017 AWS Online Tech Talks
 
S ss0885 spectrum-scale-elastic-edge2015-v5
S ss0885 spectrum-scale-elastic-edge2015-v5S ss0885 spectrum-scale-elastic-edge2015-v5
S ss0885 spectrum-scale-elastic-edge2015-v5
 
Elastic storage in the cloud session 5224 final v2
Elastic storage in the cloud session 5224 final v2Elastic storage in the cloud session 5224 final v2
Elastic storage in the cloud session 5224 final v2
 
SRV401 Deep Dive on Amazon Elastic File System (Amazon EFS)
SRV401 Deep Dive on Amazon Elastic File System (Amazon EFS)SRV401 Deep Dive on Amazon Elastic File System (Amazon EFS)
SRV401 Deep Dive on Amazon Elastic File System (Amazon EFS)
 
Deep Dive on Amazon EFS | AWS Public Sector Summit 2017
Deep Dive on Amazon EFS | AWS Public Sector Summit 2017Deep Dive on Amazon EFS | AWS Public Sector Summit 2017
Deep Dive on Amazon EFS | AWS Public Sector Summit 2017
 
Ibm total storage san file system as an infrastructure for multimedia servers...
Ibm total storage san file system as an infrastructure for multimedia servers...Ibm total storage san file system as an infrastructure for multimedia servers...
Ibm total storage san file system as an infrastructure for multimedia servers...
 
Ibm total storage san file system as an infrastructure for multimedia servers...
Ibm total storage san file system as an infrastructure for multimedia servers...Ibm total storage san file system as an infrastructure for multimedia servers...
Ibm total storage san file system as an infrastructure for multimedia servers...
 
The Pendulum Swings Back: Converged and Hyperconverged Environments
The Pendulum Swings Back: Converged and Hyperconverged EnvironmentsThe Pendulum Swings Back: Converged and Hyperconverged Environments
The Pendulum Swings Back: Converged and Hyperconverged Environments
 
IBM Spectrum Scale for File and Object Storage
IBM Spectrum Scale for File and Object StorageIBM Spectrum Scale for File and Object Storage
IBM Spectrum Scale for File and Object Storage
 
XFS.ppt
XFS.pptXFS.ppt
XFS.ppt
 
RAID and LVM
RAID and LVMRAID and LVM
RAID and LVM
 

More from sqlserver.co.il

Things you can find in the plan cache
Things you can find in the plan cacheThings you can find in the plan cache
Things you can find in the plan cachesqlserver.co.il
 
Sql server user group news january 2013
Sql server user group news   january 2013Sql server user group news   january 2013
Sql server user group news january 2013sqlserver.co.il
 
Query handlingbytheserver
Query handlingbytheserverQuery handlingbytheserver
Query handlingbytheserversqlserver.co.il
 
Adi Sapir ISUG 123 11/10/2012
Adi Sapir ISUG 123 11/10/2012Adi Sapir ISUG 123 11/10/2012
Adi Sapir ISUG 123 11/10/2012sqlserver.co.il
 
Products.intro.forum version
Products.intro.forum versionProducts.intro.forum version
Products.intro.forum versionsqlserver.co.il
 
SQL Explore 2012: P&T Part 3
SQL Explore 2012: P&T Part 3SQL Explore 2012: P&T Part 3
SQL Explore 2012: P&T Part 3sqlserver.co.il
 
SQL Explore 2012: P&T Part 2
SQL Explore 2012: P&T Part 2SQL Explore 2012: P&T Part 2
SQL Explore 2012: P&T Part 2sqlserver.co.il
 
SQL Explore 2012: P&T Part 1
SQL Explore 2012: P&T Part 1SQL Explore 2012: P&T Part 1
SQL Explore 2012: P&T Part 1sqlserver.co.il
 
SQL Explore 2012 - Tzahi Hakikat and Keren Bartal: Extended Events
SQL Explore 2012 - Tzahi Hakikat and Keren Bartal: Extended EventsSQL Explore 2012 - Tzahi Hakikat and Keren Bartal: Extended Events
SQL Explore 2012 - Tzahi Hakikat and Keren Bartal: Extended Eventssqlserver.co.il
 
SQL Explore 2012 - Michael Zilberstein: ColumnStore
SQL Explore 2012 - Michael Zilberstein: ColumnStoreSQL Explore 2012 - Michael Zilberstein: ColumnStore
SQL Explore 2012 - Michael Zilberstein: ColumnStoresqlserver.co.il
 
SQL Explore 2012 - Meir Dudai: DAC
SQL Explore 2012 - Meir Dudai: DACSQL Explore 2012 - Meir Dudai: DAC
SQL Explore 2012 - Meir Dudai: DACsqlserver.co.il
 
SQL Explore 2012 - Aviad Deri: Spatial
SQL Explore 2012 - Aviad Deri: SpatialSQL Explore 2012 - Aviad Deri: Spatial
SQL Explore 2012 - Aviad Deri: Spatialsqlserver.co.il
 
Bi303 data warehousing with fast track and pdw - Assaf Fraenkel
Bi303 data warehousing with fast track and pdw - Assaf FraenkelBi303 data warehousing with fast track and pdw - Assaf Fraenkel
Bi303 data warehousing with fast track and pdw - Assaf Fraenkelsqlserver.co.il
 
Fast transition to sql server 2012 from mssql 2005 2008 for developers - Dav...
Fast transition to sql server 2012 from mssql 2005 2008 for  developers - Dav...Fast transition to sql server 2012 from mssql 2005 2008 for  developers - Dav...
Fast transition to sql server 2012 from mssql 2005 2008 for developers - Dav...sqlserver.co.il
 

More from sqlserver.co.il (20)

Things you can find in the plan cache
Things you can find in the plan cacheThings you can find in the plan cache
Things you can find in the plan cache
 
Sql server user group news january 2013
Sql server user group news   january 2013Sql server user group news   january 2013
Sql server user group news january 2013
 
DAC 2012
DAC 2012DAC 2012
DAC 2012
 
Query handlingbytheserver
Query handlingbytheserverQuery handlingbytheserver
Query handlingbytheserver
 
Adi Sapir ISUG 123 11/10/2012
Adi Sapir ISUG 123 11/10/2012Adi Sapir ISUG 123 11/10/2012
Adi Sapir ISUG 123 11/10/2012
 
Products.intro.forum version
Products.intro.forum versionProducts.intro.forum version
Products.intro.forum version
 
SQL Explore 2012: P&T Part 3
SQL Explore 2012: P&T Part 3SQL Explore 2012: P&T Part 3
SQL Explore 2012: P&T Part 3
 
SQL Explore 2012: P&T Part 2
SQL Explore 2012: P&T Part 2SQL Explore 2012: P&T Part 2
SQL Explore 2012: P&T Part 2
 
SQL Explore 2012: P&T Part 1
SQL Explore 2012: P&T Part 1SQL Explore 2012: P&T Part 1
SQL Explore 2012: P&T Part 1
 
SQL Explore 2012 - Tzahi Hakikat and Keren Bartal: Extended Events
SQL Explore 2012 - Tzahi Hakikat and Keren Bartal: Extended EventsSQL Explore 2012 - Tzahi Hakikat and Keren Bartal: Extended Events
SQL Explore 2012 - Tzahi Hakikat and Keren Bartal: Extended Events
 
SQL Explore 2012 - Michael Zilberstein: ColumnStore
SQL Explore 2012 - Michael Zilberstein: ColumnStoreSQL Explore 2012 - Michael Zilberstein: ColumnStore
SQL Explore 2012 - Michael Zilberstein: ColumnStore
 
SQL Explore 2012 - Meir Dudai: DAC
SQL Explore 2012 - Meir Dudai: DACSQL Explore 2012 - Meir Dudai: DAC
SQL Explore 2012 - Meir Dudai: DAC
 
SQL Explore 2012 - Aviad Deri: Spatial
SQL Explore 2012 - Aviad Deri: SpatialSQL Explore 2012 - Aviad Deri: Spatial
SQL Explore 2012 - Aviad Deri: Spatial
 
מיכאל
מיכאלמיכאל
מיכאל
 
נועם
נועםנועם
נועם
 
עדי
עדיעדי
עדי
 
מיכאל
מיכאלמיכאל
מיכאל
 
Bi303 data warehousing with fast track and pdw - Assaf Fraenkel
Bi303 data warehousing with fast track and pdw - Assaf FraenkelBi303 data warehousing with fast track and pdw - Assaf Fraenkel
Bi303 data warehousing with fast track and pdw - Assaf Fraenkel
 
DBCC - Dubi Lebel
DBCC - Dubi LebelDBCC - Dubi Lebel
DBCC - Dubi Lebel
 
Fast transition to sql server 2012 from mssql 2005 2008 for developers - Dav...
Fast transition to sql server 2012 from mssql 2005 2008 for  developers - Dav...Fast transition to sql server 2012 from mssql 2005 2008 for  developers - Dav...
Fast transition to sql server 2012 from mssql 2005 2008 for developers - Dav...
 

Recently uploaded

Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsAndrey Dotsenko
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentationphoebematthew05
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsPrecisely
 

Recently uploaded (20)

Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentation
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power Systems
 

ISUG 113: File stream

  • 1. File Stream Microsoft SQL Server 2008 R2 Kobi Cohen System DBA Manager Spiral Solutions
  • 2. Objectives  Familiarization with FILESTREAM  Overview  Storage  Security & Access  Implementation  Application Considerations  Combined with other SQL Server features  Cluster Configuration  RBS (Remote BLOB store) ©Spiral Solutions, Ltd. All rights reserved.
  • 3. File Stream Overview  For unstructured data  docs, images, videos.  not new data type  Storage attribute.  Varbinary (max) only  Fully transactional.  BLOBs saved on storage (NTFS file system)  Needs coordination between DBA and System Administrator.  Can be accessed by T-SQL (DMLs) or Win32 API (stream access).  Use NT system cache:  Much faster  Avoid double writing (Buffer cache + Disk).  Reduce load from DB engine.  SQL Server buffer pool isn’t used  more free memory.  BLOB size limited only by the volume size (not limited to 2GB) even in Express Edition. ©Spiral Solutions, Ltd. All rights reserved.
  • 4. File Stream Overview  Store BLOBs in table? On separate files? or in FILESTREAM?  Data size   Larger than 1 MB  NTFS FILESTREAM.  Smaller than 256 KB  inside the database.  Between 256 KB and 1MB  depend on read vs. write ratio + overwrite rate.  Performance  Fast read access is important NTFS FILESTREAM.  Transactional Consistency  BLOB + structured data  FILESTREAM.  Security  sensitive data  FILESTREAM  SQL security over ACLs.  Manageability  integrated solution  less complex  FILESTREAM.  Data fragmentation  frequent updates  easier to handle on NTFS.  Client access  Using DB access protocols (ODBC, OLEDB)  NTFS FILESTREAM. ©Spiral Solutions, Ltd. All rights reserved.
  • 5. File Stream Overview BLOB Storage Methods Comparison Storage solution Comparison point SQL Server (using File server / file system FILESTREAM varbinary(max)) Maximum BLOB size NTFS volume size 2 GB – 1 bytes NTFS volume size Streaming performance of large Excellent Poor Excellent BLOBs Security Manual ACLs Integrated Integrated + automatic ACLs Cost per GB Low High Low Manageability Difficult Integrated Integrated Integration with structured data Difficult Data-level consistency Data-level consistency Application development and More complex More simple More simple deployment Recovery from data fragmentation Excellent Poor Excellent Performance of frequent small Excellent Moderate Poor updates ©Spiral Solutions, Ltd. All rights reserved.
  • 6. File Stream Overview Read Performance Comparison (Cold buffer pool) ©Spiral Solutions, Ltd. All rights reserved.
  • 7. File Stream Overview Read Performance Comparison (Warm buffer pool) ©Spiral Solutions, Ltd. All rights reserved.
  • 8. File Stream Overview Insert Performance Comparison (Cold buffer pool) ©Spiral Solutions, Ltd. All rights reserved.
  • 9. File Stream Overview Update Performance Comparison (Cold buffer pool) ©Spiral Solutions, Ltd. All rights reserved.
  • 10. File Stream Storage  Preparing for FILESTREAM:  Set the proper Disk/RAID level  resilience, performance, cost, load.  Use FSUTIL :  Turn off short (8.3) file names.  Disable last access time.  Format volume cluster size  Use 64-KB NTFS clusters  4-KB for compressed volumes.  Compress volume  extra CPU.  Regularly defrag FILESTREAM computer systems.  Set antivirus scan of FILESTREAM volumes to avoid delete infected files  quarantine if it’s a must. ©Spiral Solutions, Ltd. All rights reserved.
  • 11. File Stream Storage  FILESTREAM stored in special file groups:  File system filter per each volume  one for SQL Server version  Integrated security is a must.  File system directories (data containers) instead of data files (mdf, ndf).  FILESTREAM file group = FILESTREAM data container.  Adding file to FILESTREAM file group = define data container:  Each logical file name is the root directory name.  Filestream.hdr  FILESTREAM metadata describing data container.  $FSLOG  FILESTREM equivalent to transaction log.  FILESTREAM operation  mapped to LSN.  FILESTREAM garbage collection thread  triggered by CHECKPOINT.  DBCC CHECKDB  for validates link-level consistency. ©Spiral Solutions, Ltd. All rights reserved.
  • 12. File Stream Storage  File stream storage considerations:  Separate FILESTREAM data containers from:  OS volumes and paging file volumes.  Tempdb volumes.  Databases data & log files volumes.  Each data container on separate volume  granular control.  Data containers cannot be nested.  All FILSTREAM columns data in a table must be stored in same FILESTREAM file group  FILESTREAM_ON better performance.  Each row must have non-null unique row id (uniqueidentifier ROWGUID) and a unique/primary key index (clustered only for non-random data to avoid index reordering on every insert/delete).  Can use partitioning on uniqueidentifier column for load balancing. ©Spiral Solutions, Ltd. All rights reserved.
  • 13. File Stream Security & Access  FILESTREAM is secured like other data:  GRANT permission on DB, schema, table or column.  NTFS permissions (ACLs) are ignored.  Only SQL Server service account is granted NTFS access to data containers to avoid outside data editing.  Requires integrated security (Windows authentication)  Windows token  pass client identity in file I/O operation.  Support snapshot isolation level (only in 2008 R2).  Remote access By Server Message Block (SMB) protocol.  Firewall considerations:  Enable both client & server to resolve DNS names.  Open file-sharing TCP ports: 139, 445 (for remote access). ©Spiral Solutions, Ltd. All rights reserved.
  • 14. File Stream Security & Access  Dual programing model to access BLOBs:  T-SQL for DMLs:  Insert  can be used with null value, empty (‘’) value or short inline data.  Update  if FILESTREAM field is set to null, the related BLOB is deleted. Partial field update can’t be done with T-SQL (use UPDATE.Write()) since update = create new copy of FILESTREAM data file + delete old file. Partial update only by: FSCTL_SQL_FILESTREAM_FETCH_OLD_CONTENT  Delete or Truncate  underlined BLOB data is deleted in file system.  File system streaming access (for read & write):  Statement model  models T-SQL statements by using open & close methods  File handle is live in that scope  open handle = open transaction.  Storage namespace  DB engine controls BLOB physical file  new internal function column_name.PathName(@option) used by API to provide the logical UNC path of the BLOB to get the Win32 handle. ©Spiral Solutions, Ltd. All rights reserved.
  • 15. File Stream Security & Access  Transacted file system access  New function provides token for current session’s transaction GET_FILESTREAM_TRANSACTION_CONTEXT ()  binds file streaming operations with a started transaction. Return NULL if there is no explicitly started transaction.  In C++/ODBC  SQL Native Client 10  OpenSqlFilestream  Win32 handle.  In C#  .NET Framework 3.5 SP1  SqlFileStream Data Type  path name + transaction token  handle can be passed to Win32 File API.  Write-through from remote client  No write operation are cached on client side  better to make fewer writes with larger data size. ©Spiral Solutions, Ltd. All rights reserved.
  • 16. File Stream Demo Demo ©Spiral Solutions, Ltd. All rights reserved.
  • 17. File Stream Application Considerations  Use NULL instead of 0x for non-initialized FILESTREAM column to avoid file creation.  Avoid insert & update in tables with NOT NULL FILESTREAM columns  decrease application performance over time.  In replication  use NEWSEQUENTIALID() instead of NEWID()  for better performance.  Avoid T-SQL for update, append, prepend data to FILESTREAM BLOB  will be spooled into tempdb.  Avoid appending small BLOB updates  Causes FILESTREAM files to be copied  Write BLOB into varbinary(max) parameter and do single write operation.  Avoid getting lots of BLOB files length in application use DATALENGTH() in T-SQL  does not open the BLOB. ©Spiral Solutions, Ltd. All rights reserved.
  • 18. File Stream Combined with other features  Snapshots  Only by excluding FILESTREAM file groups  FILESTREAM file groups will be marked as offline.  Replication Supported by both transactional & merge with many considerations  SQL 2008 or later on all subscribers.  Log Shipping  supports FILESTREAM.  Mirroring  Does not support FILESTREAM.  Clustering  fully supported. Must enable FILESTREAM on all nodes  Backup & Restore  Fully supported on all recovery models.  Encryption  is not supported even when TDE is enabled.  Indexes  cannot be a part of: index key / include column / statistics.  Constraints (PK,FK,UQ) cannot be created on FILESTREAM column.  Temp tables & TVP  cannot be used in local/global temp tables & TVP. ©Spiral Solutions, Ltd. All rights reserved.
  • 19. File Stream Cluster Configuration  Data containers must be on shared disk resource.  Separate LUN for FILESTREAM is recommended.  Steps for enabling FILESTREAM:  Enable file stream on service level  on all nodes.  Windows Share Name must be the same on all nodes.  Allow remote clients access  create a file-share cluster resource.  Enable file stream on instance level (facets)  on all nodes.  Add dependency of FILESTREAM LUN to SQL Service.  Take SQL Service off & Bring SQL Service + dependencies on.  NetApp Snap Manager requirements:  Separate LUNs to data files, Log files & FILESTREAM files. ©Spiral Solutions, Ltd. All rights reserved.
  • 20. File Stream RBS  Complementary approach  store BLOBs on remote storage.  Provided with SQL Server 2008 R2 Feature pack.  library API set  moving BLOBs from MS SQL to external storage.  Set of SPs and SDK  RBS provider for File stream.  Client-side DLL linked into a user application + stored procedures on SQL Server. ©Spiral Solutions, Ltd. All rights reserved.
  • 21. File Stream Useful Links  FILESTREAM Storage in SQL Server 2008: http://msdn.microsoft.com/en-us/library/cc949109(v=sql.100).aspx  To BLOB or Not To BLOB - Large Object Storage in a Database or a File system: http://research.microsoft.com/apps/pubs/default.aspx?id=64525  How to enable FILESTREAM from the command line: http://sqlsrvengine.codeplex.com/wikipage?title=FileStreamEnable&referri ngTitle=Home&ProjectName=sqlsrvengine  FSUTIL syntax: http://technet.microsoft.com/en-us/library/cc785435(v=ws.10).aspx  SQL Server 2008 R2 Remote Blob Store (RBS) Download : http://www.microsoft.com/download/en/confirmation.aspx?id=16978 ©Spiral Solutions, Ltd. All rights reserved.
  • 22. File Stream End Thanks ©Spiral Solutions, Ltd. All rights reserved.