RAID (Redundant Array of Inexpensive Disks) is the combining of multiple disks to mimic a single physical storage device. Depending on the type, or “level”, RAID can increase performance, capacity, fault tolerance, or combinations thereof. So, what is RAID 5?
What is RAID 5?
RAID 5, which requires at least three drives, is similar to RAID 0 in that it stripes (distributes evenly) data across multiple disks, however, parity info is also striped across all the drives for data redundancy. Parity blocks never reside on the disk that contains the data they protect. RAID 5 is the lowest level that uses distributed parity–RAID 3 and 4 store parity info on a single disk.
What is Parity Info?
Parity information at its most basic level is a bit (binary 1 or 0) resulting from an XOR (Exclusive OR) operation between two bits of data. If both data bits are 1, or both are 0, then the resulting parity bit is 0. If the bits don’t match then the resulting parity bit will be 1.
Why XOR? Palindromic operation. If either of the original bits go missing, performing XOR on the remaining data bit and the generated parity bit results in the original value of the missing bit. E.g.,
- Create parity bit: 1 XOR 1 = 0
- Restore data bit: 1 (surviving data bit) XOR 0 (parity bit) = 1
- Create parity bit: 1 XOR 0= 1
- Restore data bit: 1 (surviving data bit) XOR 1 (parity bit) = 0
- Restore data bit: 0 (surviving data bit) XOR 1 (parity bit) = 1
The Upside
RAID 5 offers very good performance and decent data safety:
- RAID 5 will continue to function after a single drive failure
- It’s fast, though slower than RAID 0 because parity data must be written
- Total array capacity is greater than with RAID 1 mirroring, though you lose the equivalent of one drive’s capacity. (16TB + 16TB + 16TB = 32TB)
- Each new disk increases the number of available data lines. The resulting broader, multi-lane pipe increases sustained read and write speeds but yields slightly slower random access times
RAID 5’s throughput performance only increases to the limit of the the bus technology involved. Multiply the maximum speed of your media and divide by the maximum bus bandwidth to determine how many disks this will take. Beyond that, additional disks only increase capacity.
The Downside
RAID 5 is safer than RAID 0, but it’s not fail-safe:
- The array fails if a subsequent drive failure occurs before the first failed drive is replaced and the array is rebuilt
- Performance will drop while the array is being rebuilt
A second drive failure occurring before a completed array rebuild is rare, but not unheard of–the strain of the rebuild can tax remaining drives. If you’re truly worried about the data, RAID 6 with its ability to withstand two drive failures offers a far better statistical margin of error.
When to Use RAID 5
Use RAID 5 when speed and capacity are paramount, but you still want a margin of safety. To maximize protection, when a drive fails, initiate a backup immediately and replace the failed drive with the utmost alacrity.
RAID 5E, or enhanced RAID 5, means that a “hot spare”, i.e., an extra disk is included in the array so that rebuilding can begin immediately without physical intervention.
This spare is also active in the array but does not increase capacity.