Core RAID Levels: RAID 0 and RAID 1
From: RAID and Data Integrity: Advanced Operating Systems Chapters 38 and 44
Core RAID Levels: RAID 0 and RAID 1
RAID is a technique that uses multiple disks together to build a storage system that can be faster, bigger, and more reliable than a single disk. As explained in Chapter 38 and 44(1) (1), RAID is designed to improve performance, increase available storage, and in some cases provide protection against disk failure.
RAID 0: Striping
RAID 0 uses striping. In this layout, blocks are spread across multiple disks in a round-robin pattern. For example, with four disks, block 0 might go to Disk 0, block 1 to Disk 1, block 2 to Disk 2, and block 3 to Disk 3, then the pattern repeats. The blocks in the same row form a stripe according to Chapter 38 and 44(1) (1).
The main purpose of striping is performance. By placing consecutive blocks on different disks, RAID 0 can serve contiguous requests using multiple disks at the same time. This increases parallelism, especially for large sequential reads or writes. Instead of waiting on one disk alone, the array can use all disks together, making RAID 0 an excellent upper bound on performance.
RAID 0 also has excellent capacity efficiency. Because there is no redundancy, all disk space is usable for data. If an array has four disks of equal size, the full combined capacity is available.
However, RAID 0 provides no fault tolerance. The source notes that it is not really a RAID level in the redundancy sense because there is no redundancy. If any one disk fails, some of the striped data is lost, and the array cannot recover that missing data.
RAID 0 Summary
- Layout: Blocks are striped across disks in round-robin order.
- Performance: High, because striping increases parallelism across disks.
- Capacity efficiency: Very high; all disk space is usable.
- Fault tolerance: None; a single disk failure can destroy the array’s data.
RAID 1: Mirroring
RAID 1 uses mirroring. In a mirrored system, more than one copy of each block is stored, and each copy is placed on a separate disk. A typical RAID 1 system keeps two physical copies of every logical block, as described in Chapter 38 and 44(1) (1).
For example, if block 0 is stored on one disk, the same block 0 is also stored on another disk. In the example from the source, Disk 0 and Disk 1 contain identical contents, while Disk 2 and Disk 3 also contain identical contents. This duplication is what gives RAID 1 its reliability.
In terms of fault tolerance, RAID 1 can tolerate a disk failure because the missing data can be read from the surviving mirror copy. This is the key recovery advantage of mirroring: when one disk fails, the system still has another complete copy of the data.
For write performance, RAID 1 has extra cost. The source states that when writing to a mirrored RAID, the system must perform two physical I/O operations for every one logical write, because both copies must be updated. In other words, mirroring duplicates writes.
For read behavior, RAID 1 can still offer benefits because either copy may be used for reading. While the source emphasizes reliability most strongly, the presence of multiple copies can help the system continue operating after a disk failure and can provide flexibility in serving reads.
The tradeoff is capacity efficiency. Because each block is stored twice, only half of the raw disk capacity is available for unique data in a two-way mirror. This is much less space-efficient than RAID 0, but it provides much stronger protection.
RAID 1 Summary
- Layout: Each block is duplicated on a separate disk.
- Performance: Writes require duplicate physical writes; reads may use either copy.
- Capacity efficiency: Lower; with two copies, usable capacity is about half of raw capacity.
- Fault tolerance: High compared with RAID 0; data can survive a disk failure.
Direct Comparison: RAID 0 vs. RAID 1
- Layout: RAID 0 spreads data across disks, while RAID 1 duplicates data across disks.
- Performance goal: RAID 0 focuses on speed through parallelism; RAID 1 focuses on reliability through duplication.
- Writes: RAID 0 writes each block once, but RAID 1 must write each block to both mirror copies.
- Capacity: RAID 0 uses all available capacity, while RAID 1 sacrifices capacity to store duplicate copies.
- Failure handling: RAID 0 cannot recover from a disk failure, while RAID 1 can recover by using the surviving copy.
Key Takeaway
According to Chapter 38 and 44(1) (1), RAID 0 and RAID 1 represent two very different design choices. RAID 0 maximizes performance and capacity by striping data across disks, using parallelism to speed up access, but it provides no redundancy. RAID 1 mirrors every block, which reduces usable capacity and requires duplicate writes, but it enables recovery from disk failure because a complete second copy of the data remains available.