How does RAID 10 works?

RAID 10, also known as RAID 1+0, is a hybrid RAID configuration that combines disk mirroring and disk striping to provide fault tolerance and improved performance. RAID 10 requires a minimum of four disks and creates a mirrored set from every pair of disks. The mirrored sets are then striped to create a single large array. This combination provides the performance benefits of RAID 0 and the fault tolerance of RAID 1.

What is RAID 10?

RAID 10 is a nested RAID configuration that was designed to provide fault tolerance and high performance. It is implemented by combining mirroring (RAID 1) and striping (RAID 0).

In RAID 10, the disks are paired up and each disk is mirrored to its partner disk. This mirroring provides fault tolerance by duplicating the data between the disks. If one disk fails, its mirrored partner still contains an intact copy of the data.

These mirrored pairs are then striped together, with segments distributed in alternating fashion across all member disks. This striping is what provides the performance benefit for RAID 10.

How does RAID 10 provide fault tolerance?

RAID 10 provides fault tolerance through disk mirroring. With mirroring, each disk has an exact duplicate of its data stored on another disk. If one disk fails, the system can instantly switch to its mirrored copy without any data loss.

For example, in a 4-disk RAID 10 array, disks 0 and 1 are mirrored, as are disks 2 and 3. If disk 0 fails, disk 1 can continue operating using the same data. Same goes for disks 2 and 3. This protects the array against a single disk failure.

With RAID 10, up to 50% of the disks can fail without any data loss, provided no more than one disk in each mirrored pair fails. If both disks in a mirrored set fail, all data will be lost. But the likelihood of this simultaneous failure is low, so RAID 10 provides excellent fault tolerance.

How does RAID 10 provide improved performance?

RAID 10 increases performance by striping data across multiple disks. This allows read and write operations to be distributed across different drives for faster I/O.

For example, in a 4-disk RAID 10 array, data is spread evenly across all four disks. If data is being written sequentially, Disk 0 and Disk 2 will fill up at the same time as Disk 1 and Disk 3. This allows the write process to be parallelized for faster operation.

During reads, data can be accessed simultaneously from all disks instead of just one. This multiplied read performance scales as more disks are added to the array.

RAID 10 is faster than RAID 1 because it combines mirroring with striping. In RAID 1, data is just written to two disks, without striping. But RAID 10 writes data across all mirrored disks in a striped fashion, boosting performance.

What are the disadvantages of RAID 10?

While RAID 10 is one of the best options for performance and redundancy, it does come with some downsides:

  • High cost – RAID 10 requires at least four disks, which is expensive compared to single-disk or two-disk options.
  • Low storage efficiency – Since data is mirrored, RAID 10 provides the storage capacity of only half the installed disks.
  • More complex setup – Configuring RAID 10 is more complicated than RAID 0 or 1 and requires more planning.
  • Slower rebuilds – Rebuilding a failed drive takes longer than with RAID 1.

What are the RAID 10 setup requirements?

To set up RAID 10, you need:

  • A RAID controller that supports RAID 10.
  • An even number of disks, minimum 4.
  • Matching disks in each mirrored pair for optimal performance.
  • Backup power supply is recommended to prevent data loss during rebuilds.

The more disks you use, the greater the fault tolerance and performance. Just ensure you use an even number of identical drives.

How is data stored on a RAID 10 array?

Data is stored across a RAID 10 array in stripes across mirrored disk pairs. Here is how it works:

  1. Disks are mirrored into identical pairs.
  2. Stripes of data are written across the mirrored pairs.
  3. If one disk fails, its mirror still contains the data.
  4. When adding more disks, additional mirrors are added and the stripe size increases.

This distribution provides redundancy through mirroring and speed through striping. The combined performance is greater than the sum of its parts.

How does RAID 10 handle disk failures?

With RAID 10, one disk per mirrored pair can fail without data loss. Here is the recovery process:

  1. Disk failure is detected by the RAID controller.
  2. The controller switches to the mirrored disk for all read and write operations.
  3. The failed disk is replaced with a new one.
  4. Data is rebuilt on the new disk by copying the data from the mirrored disk.
  5. Normal RAID 10 operation resumes after rebuild.

As long as no more than one disk in each mirrored set fails, the recovery process is quick and seamless. But if multiple disks in a set fail, data will be lost, as there is no backup copy.

What are typical RAID 10 performance benchmarks?

RAID 10 offers excellent performance for transactional workloads. Here are some typical benchmarks for RAID 10 arrays:

Benchmark 4 SSDs 6 SSDs 8 SSDs
Sequential Reads 2,200 MB/s 3,600 MB/s 4,800 MB/s
Sequential Writes 1,800 MB/s 2,600 MB/s 3,600 MB/s
4K Random Reads 400k IOPS 600k IOPS 800k IOPS
4K Random Writes 300k IOPS 450k IOPS 600k IOPS

As you add more disks, the increased stripe size boosts bandwidth and IOPS. But the gains will start diminishing after more than 8 disks.

When is RAID 10 recommended over other RAID levels?

RAID 10 excels in these scenarios:

  • Transactional databases – OLTP databases need fast small-block IO, which RAID 10 provides.
  • Read-intensive applications – The multiplied read speed helps applications like video editing or scientific data analysis.
  • Small scale setups – For smaller servers and workstations, RAID 10 offers the best combo of speed and redundancy.
  • Virtualized environments – Hypervisors can take advantage of RAID 10’s performance for optimal guest VM latency.

If your workload requires consistently fast response times from a relatively small number of drives, RAID 10 is an excellent choice.

When should other RAID levels be used instead of RAID 10?

There are some cases where other RAID levels may be preferable:

  • Large arrays – Once you get above 8 drives, consider RAID 60 for large-scale redundant arrays.
  • Media storage – For large sequential writes, like video editing, RAID 5 or 6 offer larger capacity.
  • Archival storage – If data redundancy is critical and performance less important, use RAID 6.
  • Budget constraints – If cost is a concern, RAID 1+0 can offer double parity for less.

In general, opt for RAID 10 when performance and redundancy are top priorities. Use other RAID options when you need large capacity for archival data and can compromise on speed.

What does RAID 10 cost?

RAID 10 is one of the more expensive RAID options given its minimum 4-disk requirement. Here are some typical hardware costs for entry-level RAID 10 setups:

  • 4 x 2TB SATA hard drives – $400
  • RAID controller card – $200
  • Cables and enclosure – $100

So an affordable barebones RAID 10 array can be built for around $700 plus the cost of a server or workstation to install it in.

Using enterprise-class SSDs instead of hard drives will significantly increase the cost. For example, a 4-disk RAID 10 array with 800GB SSDs could cost over $5,000.

Keep in mind that you need to double the number of disks for RAID 10 versus RAID 1 or 5. So as you scale up, the costs grow quickly.

Can you expand a RAID 10 array?

Yes, RAID 10 arrays can be expanded by adding additional mirrored pairs of drives. For example, you can go from a 4-disk to 6-disk configuration.

The expansion process is as follows:

  1. Add two new matched drives to empty bays in your server.
  2. Make sure the new disks are identical to your existing ones.
  3. In your RAID controller, select the option to expand the array.
  4. The controller adds the new disks as an additional mirrored set.
  5. Data is rebalanced across the new larger array.

This expansion on the fly allows you to grow your RAID 10 storage as needed. Just make sure to do it in pairs of disks to maintain the mirroring.

Can a RAID 10 array be reconfigured without data loss?

Yes, RAID 10 can be reconfigured into a new layout using the following process:

  1. Back up your RAID 10 data.
  2. Delete the existing RAID 10 array.
  3. Create a new RAID 10 array with the desired configuration.
  4. Restore the backup to the new array.

As long as you have a complete backup, you can safely delete and recreate the array into any RAID 10 configuration needed. This allows you to change the stripe size or number of disks.

Reconfiguring on the fly without a backup will cause data loss. The RAID controller can’t guarantee your data will end up on the same disks.

Conclusion

RAID 10 provides an excellent combination of performance and fault tolerance using mirroring and striping. It requires a minimum of four disks and works best for transactional databases, virtual machines, and other applications needing consistently fast IO.

While RAID 10 is more expensive than other RAID options, the speed and redundancy benefits make it worth the premium for many use cases. Just ensure you size and configure your array properly at the outset to maximize the advantages.