SQL Server – Best Practices for Placing Database Files in a Shared Folder

sql server

Is it a normal practice with MS SQL Server to place databases in remote shared folders on a fast local network rather than on the physical HDD where the server software is installed? What problems shall one fear that local placement avoids? For example, can a network glitch cause .mdf and .ldf to become inconsistent through successful modificaion of the one and failure to modify the other?

EDIT:
Whereas Microsoft recommends employment of Storage-Area Network (SAN) or SCSI instead of simple shared folders, could you please tell me the disadvantages of the latter?

Best Answer

The key differentiator between the recommended locations (e.g. local storage, a SAN, or an iSCSI-based network) and a network share is quite simply, redundancy. All of the recommended approaches provide an option for redundant paths for I/O to take to persistent storage.

For instance, you can RAID local storage, providing redundancy if any disk fails. With either the SAN or iSCSI-based network storage approaches, these technologies use Multipath Input/Output (MPIO) drivers, providing redundancy to the storage.

A network drive, in contrast, does not employ or allow for any redundant I/O paths. If a Network Interface Controller (NIC) fails on either end, the share likely disappears. Even if you have multiple NICs, there will still be a brief outage as a different IP address will now host that share, so any data sent to the old/failed IP will timeout and disappear. Basically a network share wasn't designed with this level of redundancy, and a loss of data mid stream may corrupt your database (or worse just get lost without a trace). The whole point of a database is to reliably store data and a network share brings that whole reliable aspect into question.