RAID — Redundant Arrays of Independent Disks
Lecture 9 · disk organization techniques that manage a large number of disks, providing the view of a single disk of high capacity and high speed (multiple disks in parallel) and high reliability (data stored redundantly so it can be recovered even if a disk fails).
Why RAID exists
- Techniques for using redundancy to avoid data loss are critical with large numbers of disks.
- Originally a cost-effective alternative to large, expensive disks — the “I” in RAID originally stood for “inexpensive”.
- Today RAIDs are used for their higher reliability and bandwidth, and the “I” is interpreted as independent.
The core statistical fact. The chance that some disk out of a set of N disks will fail is much higher than the chance that a specific single disk will fail. A system with 100 disks, each with an MTTF of 100,000 hours (≈ 11 years), has a system MTTF of only 1,000 hours ≈ 41 days.
Improvement of Reliability via Redundancy
Improvement in Performance via Parallelism
1 · Reliability via redundancy
Reliability means the ability of the database to store and provide correct, consistent, complete and available data whenever it is needed — even system failures do not destroy stored data.
Redundancy means storing extra information that can be used to rebuild information lost in a disk failure.
Redundancy means storing extra information that can be used to rebuild information lost in a disk failure.
Mirroring (shadowing) — also known as RAID 1
- Duplicate every disk. One logical disk consists of two physical disks.
- Every write is carried out on both disks.
- Reads can take place from either disk.
- Reliability: if one disk in a pair fails, the data is still available on the other.
- Data loss occurs only if both disks fail before the system is repaired.
The probability of the combined event (both disks failing simultaneously) is very small — except for dependent failure modes such as fire, building collapse or electrical power surges.
So the system becomes unsafe only during the repair window. Mean time to data loss depends on mean time to failure and mean time to repair.
MTTDL — the worked derivation
Example. A system with 2 disks; each with MTTF (Mean Time To Failure) = 100,000 hours (≈ 11 years); MTTR (Mean Time To Repair) = 10 hours. What is the MTTDL (Mean Time To Data Loss)?
| Step | Reasoning | Result |
|---|---|---|
| 1 Failure rate of one disk | If one disk has MTTF = 100,000 hours, its failure rate is λ = 1/MTTF. | /hr |
| 2 First failure in a mirrored pair | There are 2 disks, so the rate at which either one fails first is doubled — either disk may be the first failed one. | |
| 3 Vulnerable period | Once one disk fails there is only one surviving disk. If it fails during the 10-hour repair time, data is lost. The probability of that is approximately λ × MTTR. | |
| 4 Data-loss rate | Multiply the two: , so MTTDL is its reciprocal. |
Step 5 & 6 — put the values in and convert
Live MTTDL calculator
MTTDL = MTTF² / (2 × MTTR) = 500.00 × 10⁶ hours
≈ 57,078 years
≈ 57,078 years
Try the exam variant: MTTF 50,000 h and MTTR 5 h.
What the number actually means
This does not mean the mirror will actually run for 57,000 years. It means that, on average and under the mathematical assumptions, data loss is extremely rare because: a single disk failure is tolerated · data loss needs two failures · and the second failure must happen in a very short period — the 10-hour repair window.
Why the number becomes so large. One disk fails every 100,000 hours on average, but for data loss you need ① one disk to fail, and then ② the other disk to fail before the repair completes. That second event is much less likely, so the expected time to data loss becomes very large.
Important assumptions behind the formula: disk failures are independent · replacement/repair starts immediately · no controller failure · no common power problem · no fire/theft/human error · no correlated failures. In the viva, quoting this list is worth as much as the arithmetic.
2 · Performance via parallelism
Two main goals of parallelism in a disk system:
- Load balance multiple small accesses to increase throughput.
- Parallelize large accesses to reduce response time.
Single disk system
User-1 Read and User-2 Read both hit the same Main Disk — they queue.
User-1 Read and User-2 Read both hit the same Main Disk — they queue.
Mirrored pair
User-1 reads from the Main Disk, User-2 reads from the Mirrored Disk — load halved: response time reduced and load balanced.
User-1 reads from the Main Disk, User-2 reads from the Mirrored Disk — load halved: response time reduced and load balanced.
Striping — improving the transfer rate
| Bit-level striping | Block-level striping | |
|---|---|---|
| Idea | Split the bits of each byte across multiple disks. In an array of eight disks, write bit i of each byte to disk i. | With n disks, block i of a file goes to disk (i mod n) + 1. |
| Gain | Each access can read data at eight times the rate of a single disk. | Requests for different blocks run in parallel if the blocks are on different disks; a long sequence of blocks can use all disks at once. |
| Problem | Seek/access time is worse than for a single disk — bit-level striping is not used much anymore. | None serious — this is the striping used by RAID 0, 4, 5 and 6. |
Example of block-level striping with 2 disks: Block 1 → Disk 2, Block 2 → Disk 1, Block 3 → Disk 2, Block 4 → Disk 1 … Reading the file is twice as fast as with a single disk.
Next: RAID levels 0 – 6 →