Depending on who you ask RAID typically stands for Redundant Array of Independent Disks, or the older and less frequently used definition of Redundant Array of Inexpensive Disks. Regardless of which definition you prefer, what RAID is and what it accomplishes remains the same - the array is a hardware abstraction. All varieties of RAID serve to combine multiple disks in various configurations to present one virtual disk to the operating system. This can be useful if you need a block of storage space that’s larger than what a single disk can offer, or if you want to allow fault tolerance for hardware failures.
Before we go much further, I need to hammer home that the key thing to remember is that by increasing the complexity of your storage solution you are increasing the likelihood of an error that will cause some level of data loss, so ensuring you have proper backup solutions and procedures in place becomes even more imperative than it already is.
Now that we know that RAID is a series of hardware abstraction configurations, let’s look at the most common configurations you’ll find in the wild. These configuration options are typically referred to either as RAID levels, and expressed as “RAID X” with X being the level number. Also note that while in the past it has often been required to use identical disks as members of an array, most modern implementations can handle differing drives to a certain extent. Using differing drives will still have impacts on either performance or capacity depending on the configuration used, and it is still often both easier and a best practice to use the closest to identical drives as is reasonably possible.
Data is spread across multiple drives in a “striped” configuration. When data is written, sequential bits are written across the different drives. This process can greatly increase write speeds, and has a direct additive effect on available storage space. Total capacity of the array is equal to the total capacity of all component drives added together.
Note that with RAID 0 there is no redundancy, and a failure in any drive can lose all data across all drives. Never use RAID 0 alone without some additional form of data protection unless the your use case is reliant entirely on speed and the data is not important. Rebuild time is N/A as there is no fault tolerance.
Typically used with two drives, but some implementations allow for more. Data is simultaneously written to two or more drives and all drives are exact copies of each other at all times. Read speeds can be improved in this mode. Write speeds will be that of either a single drive, or the slower of the drives used if there is a difference. Capacity of the array is equal to the capacity of one drive if the drives are the same size, or the smallest of the drives if there is a disparity. Data rebuild times are pretty quick as replacing a failed drive just requires a direct copy of data from the mirrored drive(s) without any additional calculations involved.
Data is striped across all drives in the array similarly to RAID 0, but introduces a parity drive to allow data rebuild in the event of a drive failure. Parity bits are introduced and shared across drives, so that the specific drive that fails does not impact rebuild ability. The array can be recovered after the loss of any one drive, but a loss of more than one drive will lose all data on the array.
If all drives are if the same capacity, then capacity of the array is the combined capacity of x(n-1) where x is the capacity of one drive and n is the number of drives. If the drives differ, then x is the capacity of the smallest drive.
Significant performance penalties are introduced with the calculation of the parity bit, and rebuild times of an array are often higher than the expected time to failure of a second drive. Rebuild time is SLOW as data is recalculated literally bit by bit. RAID 5 is an interesting idea, but should NEVER be used in production.
Pretty much identical in all ways to RAID 5, but parity is arranged in such a way that the array can tolerate a loss of two drives. RAID 6 is often safe enough for production use provided that a reliable backup solution is also deployed.
At this point its pretty obvious that if you want both additive capacity and fault tolerance while maintaining performance benefits that none of the base RAID levels really cut the muster. Most production deployments use some form of combined array, with the common ones listed below.
A stripe of mirrored drives. This is among the most common implementation that you’ll find in the wild, and for good reason. Requires and even number of drives as each drive in the stripe has a pair that contains a mirror. Some implementations also allow you to have hot spares ready for rebuild, but these are additional drives and not part of the array count for capacity and performance calculations. Performance is very good as we get a boost on both read and write operations. Fault tolerance depends on the number of drives in the array, but one drive from each mirrored set can be lost and the array still recovered. Rebuild time is very good as data is directly copied from a mirror when a drive is replaced.
Capacity is x(n/2) where x is the capacity of one drive (the smallest drive if there is discrepancy) and n is the number of drives.
Similar to RAID 10, but the striped array is made up of RAID 5 arrays. In most cases the extra capacity gained is not worth the performance losses.
Similar to RAID 10, but the striped array is made up of RAID 6 arrays. In most cases the extra capacity gained is not worth the performance losses.
There's more to RAID than what we've delved into in this short exploration. There are less frequently used levels that fit niche use cases, or that have become anachronistic as time and technology move forward. There's differences between hardware and software implementations. Different vendors can have slight differences in how different levels are treated. Any time you're dealing with hardware implementations there's a fairly extreme rabbit hole you can go down; this is just meant as an introduction and familiarization with general concepts. There are also new alternatives to traditional RAID levels that you'll find in ZFS systems and the like. Always stay curious and keep learning.