RAID stands for either Redundant Array of Inexpensive Disks or Redundant Array of Independent Disks. It is a data storage virtualisation solution that treats multiple physical drives as a single physical drive. The purpose of RAID is to provide data redundancy, performance improvements, or both depending on the RAID level used.
The three main concepts in RAID are “mirroring”, “striping”, and “parity”.
In RAID, mirroring is the replication of data across multiple disks, this allows for a level of redundancy at the cost of reduced storage capacity. For example, if one drive fails, no data is lost, as all the data on the failed drive is also on a second drive. At this point, the failed drive can be replaced and the RAID array can be rebuilt from existing drives.
RAID striping is the concept of spreading data across multiple drives. This allows for the full capacity of all drives to be available for use and allows for greater performance as data is being written-to or read-from multiple drives simultaneously. The downside of this that the loss of any drive corrupts the entire array.
RAID parity is a fault tolerance process that performs a logical process between each bit on two drives and stores the result on a third drive. If any of the drives fail, the array can be rebuilt from the other two. Parity can only be added on top of other raid states.
Common RAID levels
RAID 0 is a simple implementation of striping. Two or more disks are included in the array, combining their overall capacities and read/write speeds. This raid level offers high performance but at the risk of the loss of all data if any drive fails. The performance of a RAID 0 array increases as you add more drives, however, this also increases the likelihood of one of the drives failing and corrupting the entire array.
Tip: RAID 0 is different from simply spanning multiple disks together. Both techniques allow the use of the full capacity of the drives. Spanning the disks together doesn’t provide the performance boost that comes from striping data, but it does preserve the data saved to working disks if any spanned disk fails.
RAID 1 is an implementation of mirroring, with data from one drive mirrored to a second drive. If either drive fails, no data is lost. In larger arrays, each disk still contains exactly the same information. As long as one RAID 1 disk is functioning, the data can be read, and the array rebuilt.
RAID levels 4 and 5 use striping to increase performance, but include parity as well, to allow for drive failures. RAID 4 dedicates a single drive to parity, this can cause reduced write speeds as all parity data is only being written to one disk. RAID 5 spreads the parity data across all drives in the array. The bottleneck that came from writing parity data to one disk is removed, however, the parity processing still needs to be performed reducing the performance a bit in comparison to RAID 0. RAID levels 4 and 5 both require at least three drives in the array and only allow for a single drive to fail.
RAID 6 is identical to RAID 5 but stores two parity blocks across all disks in the array. This extra parity doubles the parity processing required, thus reducing performance more than RAID 5, but still less than RAID 4. RAID 6 requires at least four drives in the array but can handle up to two drives failing.
RAID 0+1 is nested RAID array, it first creates a RAID 0 array of striped disks, then a RAID 1 mirror of that array. Nesting these two types of RAID arrays provides both the redundancy of the mirroring and the speed boost of the striping. The downsides of this method are that at least four drives are required and that if a drive fails, an entire mirror fails. If any drive fails, it corrupts its RAID 0 array. In a four disk RAID 0+1 array, losing a single disk would corrupt its paired disk leaving the other two disks without the protection of a mirror.
RAID 10 is another type of nested RAID array, it creates a RAID 1 array of mirrored disks, then a RAID 0 stripe of that array. Nesting the arrays this way also provides the same redundancy and performance boost as RAID 0+1. With this implementation, however, you can lose many drives as long as each mirror has at least one working disk. It also takes less time to rebuild the array in the case of a drive failure, as only one set of mirrored drives need to be rebuilt.