RAID (Redundant Array of Independent Disks)

P&S DRAFTS.
Nerd For Tech
Published in
4 min readJul 22, 2022

What is RAID?

RAID is a way of storing the same data in different places over multiple hard disks or solid state drives. It is done to provide redundancy and prevent data loss in case of disk failure.

Instead of storing all the data in a single disk, RAID stores data in multiple small-sized disks allowing faster I/O operations and data protection. This improves the robustness of the whole system. In case a disk fails in the system, the other disks remain safe and the entire system doesn’t crash.

Credits: Tapscape

RAID Techniques

RAID employs certain techniques for data protection: Stripping, Mirroring, Parity.

Stripping

It is the technique where data is spread across multiple drives (more than one) and all these drives are used in parallel.This allows more data to be processed in a shorter time and increases the performance, compared to reading and writing from a single disk.In a RAID set within each disk, there is a predefined number of contiguously addressable disk blocks called as a strip. A set of aligned strips that spans across all these disks within the RAID set is called a stripe.

Strip and Stripe representation

All strips in a stripe have the same number of blocks. Stripping data doesn’t provide any kind of data protection until it is mirrored or paired.

Mirroring

Mirroring is a technique where the same data is stored in 2 different disks drives(more like 2 copies of the same data ). Let’s say one of the two disk drive crashes but the data will be still intact on the other disk. This way the data is protected from any kind of loss. If one disk drive fails, the data intact on the surviving disk drive helps the controller continue its service to the host’s data requests.When the failed disk is replaced with a new disk, the controller copies the data from the surviving disk of the mirrored pair.

Mirroring (Credits: Storage Tutorials)

Mirroring allows complete redundancy and enables faster recovery from disk failure. Since it involves duplication of data it requires twice the storage space needed to store the data originally and is pretty expensive.

Note:Mirroring and data backup are not similar since mirroring constantly captures changes in the data, while a backup captures point-in-time images of the data.

Parity

It is the technique of protecting striped data from disk drive failures without the additional mirroring cost.Here an additional disk drive is used to hold the parity value.Parity is a redundancy technique. Parity value is calculated by the RAID controller. It is calculated using a mathematical construct that allows recreation of missing data.

For example let’s take 4 disks D1,D2, D3 and P. D1,D2 and D3 are data disks where data is stored. P is the Parity disk which stores the parity information (in the figure shown below parity value is the sum of the elements in each row). If any one of the data disk fails it can be recreated by subtracting the parity value of the row from the sum of the elements in each row.

Let’s say D2 fails, its elements can be recreated by subtracting Parity Value(6) from sum of that row’s element (1+2=3).

6–3=3 (Hence now we know that the missing value is 3)

Parity Disk Representation (Credits: Storage Tutorials)

Computation of parity is represented as an arithmetic sum of the data. Parity
calculation is a bitwise XOR operation.

XOR Truth Table

If any of the data from IN1, IN2, or OUT is lost, it can be recreated by performing an XOR operation on the remaining available data.

Parity is cheaper and occupies less storage when compared to Mirroring.

There is something called RAID Levels which is a set of configuration that tells how RAID employs Stripping, Mirroring and Parity to create large reliable data stores from multiple general purpose computer hard disk drives. Will know more about it in the next article.

Written by, R P PAVITRA

--

--

P&S DRAFTS.
Nerd For Tech

Hello! Welcome to P&S DRAFTS. Our names are Pavitra and Smruthi (P&S).