RAID stands for Redundant Array of Independent Disks. It is a method of configuring two or more hard drives to work as a single unit with different levels of redundancy and better fault tolerance.
Software vs Hardware RAID
We can deploy RAID using software or hardware
Most operating systems come with software RAID support. It allows for faster and easier deployments. The caveat there is that software RAID operates on the partition level. Complexity increases when increasing the number of partitions and in the case of power failure, the cache is lost. Performance also decreases as your nest RAID levels. This configuration is better suited for single servers. Ideal RAID configurations for these are RAID 0 and RAID 1.
Hardware RAID costs higher but is less complex to manage than software RAID. In case of power failures, a backup battery maintains the cache. Performance is far superior compared to software RAID and can support hot disk swapping or hot spare. Hardware RAID has higher write throughput and faster reconstruction of data loss. This is the preferred configuration for mission critical servers like database servers.
Common RAID Types
This is known as RAID 0. Striping has no data protection. It does however increase disk speed for utilization in data-intensive software such as video production. Striping breaks the code into blocks of data and alternates between two disks. This allows both to read or write simultaneously thus spreading workload and decreasing wait times.
This is known as RAID 1. Mirroring copies a duplicate of the information being written to two or more disks. This is often referred to as a "mirrored pair". RAID 1 has no striping or parity and the disks must be of the same size. If it is not, then the array is only as large and fast as its smallest and slowest disk.
RAID with Parity/Error Correction
Parity is designed to detect and correct errors. It also helps with redundancy. It works by calculating the XOR (exclusive), which compares two numbers and outputs true or a 1 only if the numbers differ. For example, if a secondary drive fails, then the third parity drive is used to recover it by doing a XOR calculation based on the parity drive and the first drive.
Known as striped array with error correction. Rarely used. This is striping with ECC (Error Correcting Code). It stripes data by bits rather than larger chunks.
Known as byte-level striping with parity. No longer in use. No significant advantages over other similar RAID levels. Performs byte-level striping with a dedicated parity drive. This RAID level is not effective for applications that do small read and write operations over the disk. It is more suited to long, sequential read and write operations.
Known as block-level striping with parity. It uses a single dedicated parity disk which causes poor performance for random writes but it has good performance in random reads. It is basically RAID 3 but with longer read and write blocks.
Known as block-level striping with distributed parity. This configuration evens out the stress by caused by RAID 4 in using a single dedicated parity disk by distributing parity. Since parity writes are distributed, write performance is increased.
Known as block-level striping with dual distributed parity. It is basically RAID 5 with multiple parity blocks per disk. In larger arrays, multiple disks can fail before the entire array fails.
All 6 RAID levels provide improvements over using a single disk. It can either be for speed, redundancy, or parity checks. To further increase effectiveness, nested RAID was devised.
Known as "Hybrid RAID", nested RAID combines 2 or more RAID levels to gain even more performance or redundancy. Commonly used nested RAID include RAID 01, RAID 10, and RAID 50.
Known as mirrored array of striped drives. It is less resilient in the number of disk failures before the entire array fails due to the way these RAID levels are nested. RAID 01 has equivalent performance with RAID 10.
Known as striped array of mirrored drives. This is the usually recommended RAID configuration for I/O intensive applications. It combines the speed increase of RAID 0 with the redundancy of RAID 1 . Due to the way this RAID level is structured, only 50% of storage capacity is available for use.