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.

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)?
StepReasoningResult
1
Failure rate of one disk
If one disk has MTTF = 100,000 hours, its failure rate is λ = 1/MTTF.λ=1100,000\lambda = \tfrac{1}{100{,}000} /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.2λ2\lambda
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.λ×MTTR\lambda \times \mathit{MTTR}
4
Data-loss rate
Multiply the two: 2λ(λMTTR)=2λ2MTTR2\lambda \cdot (\lambda \cdot \mathit{MTTR}) = 2\lambda^2 \mathit{MTTR}, so MTTDL is its reciprocal.MTTDL=12λ2MTTR=MTTF22MTTR\mathit{MTTDL} = \tfrac{1}{2\lambda^2 \mathit{MTTR}} = \tfrac{\mathit{MTTF}^2}{2\cdot \mathit{MTTR}}
MTTDL=MTTF22×MTTR\mathit{MTTDL} = \frac{\mathit{MTTF}^2}{2 \times \mathit{MTTR}}

Step 5 & 6 — put the values in and convert

MTTDL=(100,000)2210=101020=5×108 hours=500×106 hours\mathit{MTTDL} = \frac{(100{,}000)^2}{2 \cdot 10} = \frac{10^{10}}{20} = 5\times10^{8}\text{ hours} = 500\times10^{6}\text{ hours}
500,000,00024×36557,000 years\frac{500{,}000{,}000}{24 \times 365} \approx 57{,}000 \text{ years}
Live MTTDL calculator
MTTDL = MTTF² / (2 × MTTR) = 500.00 × 10⁶ hours
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:

  1. Load balance multiple small accesses to increase throughput.
  2. 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.
Mirrored pair
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 stripingBlock-level striping
IdeaSplit 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.
GainEach 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.
ProblemSeek/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 →