Sql-server – Storing data files in separate physical drives

performancesql-server-2016

Does storing sql server data files for 1 database in different drives gain performance? Is it recommended to do so? Any benefits gained from splitting the data files to multiple physical drives? There is no partition tables .The db is oltp which is read and write intensive.

Example database
AdventureWorks

D:\Data\AdventureWorks_1.mdf
D:\Data\AdventureWorks_1.ndf
E:\Data\AdventureWorks_2.ndf
F:\Data\AdventureWorks_3.ndf
F:\Data\AdventureWorks_4.ndf

Best Answer

To answer the question, generally the best option is the S.A.M.E. for all databases!

Stripe And Mirror Everything - also known as RAID 10 (or RAID 1+0).

According to manufacturer specifications and official independent benchmarks, in most cases RAID 10[8] provides better throughput and latency than all other RAID levels[9] except RAID 0 (which wins in throughput).[10] Thus, it is the preferable RAID level for I/O-intensive applications such as database, email, and web servers, as well as for any other use requiring high disk performance.[11]

As you can see from the oracle-base link (an absolutely super site for all things Oracle BTW), you can see that this is the preferred general RAID level for Oracle - with the proviso that one can delve a bit deeper and use other RAID levels for different file types (data, logs, control files...). See the table in the link below,

enter image description here

but this is the take-home message (IMHO) - in the RAID Levels section:

1+0 or 10 As the name suggests this is a combination of RAID 1 and RAID 0. This sounds like it should be the same as 0+1, but it is subtly different. Each disk is mirrored individually and striping occurs across all the mirrored pairs. This is the best RAID for Oracle.

So, 1+0 is definitely the preferred option.

Microsoft's page RAID Levels and SQL Server also says:

RAID 10 provides the performance benefits of disk striping with the disk redundancy of mirroring. RAID 10 provides the highest read-and-write performance of any one of the other RAID levels, but at the expense of using two times as many disks.

Note that last bit but at the expense of using two times as many disks - one gets nothing for nothing! "Yae cannae beet the laws o' physics, Jim..." (with apologies to Gene Roddenberry).

For completeness, Severalnines (a top PostgreSQL consulting company) says:

Setting up RAID for the database drives not only protects from data loss, it can also improve performance if using the right RAID configuration. RAID 1 or 10 are generally thought to be the best, and 10 offers parity and overall speed.

and for MySQL, consider Percona's advice (Percona are a very highly regarded MySQL consulting group with their own fork of the server):

The best performance without making compromises to redundancy is achieved by the use of an advanced controller with a battery-backed cache unit and preferably RAID-10 volumes spanned across multiple disks.

So, again generally, RAID 1+0 is considered the optimal solution. However, if you read around this topic, you will see that there are issues such as expense - no organisation has infinite resources, so decisions are sometimes made on budgetary grounds not to go with RAID 1+0 but rather RAID 5.

This, IMHO, is a huge mistake - it's a false economy. You might be saving some money on disks, but your employees' and customers' time (and sanity) are valuable resources in their own right (painful past experience, but I've had therapy and I'm OK now...).

So, ideally, it is better to spread data across disks. To answer the part of your question about if one is running more than one database on the same server, then questions of multi-tenancy arise.

For example, you have to ask yourself "If I take down the system, that's two clients gone or would I rather be able to take them down separately if required?". That's a question which only the stakeholders in your own organisation can answer - Management, Customers, DBA's...

Personlly, I would keep separate clients' data as separate as possible, but again you have budget considerations - a separate disk subsystem for each client, software licencing issues and the like. My advice is to read deeply around the area in order to be able to provide a sound strategy for your own organisation given the resources to hand.

p.s. +1 for an interesting question and welcome to the forum!