Saturday, December 5, 2015

RAID 0, RAID 1, RAID 5, RAID 10 Explained with Diagrams



RAID 0, RAID 1, RAID 5, RAID 10 Explained with Diagrams

RAID stands for Redundant Array of Inexpensive (Independent) Disks.
On most situations you will be using one of the following four levels of RAIDs.
  • RAID 0
  • RAID 1
  • RAID 5
  • RAID 10 (also known as RAID 1+0)
This article explains the main difference between these raid levels along with an easy to understand diagram.

In all the diagrams mentioned below:
  • A, B, C, D, E and F – represents blocks
  • p1, p2, and p3 – represents parity

RAID LEVEL 0


Following are the key points to remember for RAID level 0.
  • Minimum 2 disks.
  • Excellent performance ( as blocks are striped ).
  • No redundancy ( no mirror, no parity ).
  • Don’t use this for any critical system.

RAID LEVEL 1

Following are the key points to remember for RAID level 1.
  • Minimum 2 disks.
  • Good performance ( no striping. no parity ).
  • Excellent redundancy ( as blocks are mirrored ).

RAID LEVEL 5


Following are the key points to remember for RAID level 5.
  • Minimum 3 disks.
  • Good performance ( as blocks are striped ).
  • Good redundancy ( distributed parity ).
  • Best cost effective option providing both performance and redundancy. Use this for DB that is heavily read oriented. Write operations will be slow.

RAID LEVEL 10

Following are the key points to remember for RAID level 10.
  • Minimum 4 disks.
  • This is also called as “stripe of mirrors”
  • Excellent redundancy ( as blocks are mirrored )
  • Excellent performance ( as blocks are striped )
  • If you can afford the dollar, this is the BEST option for any mission critical applications (especially databases).

Striping, Mirroring & Parity


Striping, Mirroring & Parity

1. Striping :
For me, Striping is the most confusing RAID level as a beginner and needs a good understanding and explanation. We all know that, RAID is collection of multiple disk’s and in these disk predefined number of contiguously addressable disk blocks are defined which are called as strips and collection of such strips in aligned in multiple disk is called stripe.

RAID Striping

Suppose you have hard disk, which is a collection of multiple addressable block and these blocks are stacked together and called strip and you have multiple such hard disk, which are place parallel or serially. Then such combination of disk is called stripe.
 Note: Without mirroring and parity, Striped RAID cannot protect data but striping may significantly improve I/O performance.


> Disk striping is the process of dividing a body of data into blocks and spreading the data blocks across multiple storage devices, such as hard disks or solid-state drives (SSDs). A stripe consists of the data divided across the set of hard disks or SSDs, and a striped unit, or strip, that refers to the data slice on an individual drive.
2. Mirroring :Mirroring is very simple to understand and one of the most reliable way of data protection. In this technique, you just make a mirror copy of disk which you want to protect and in this way you have two copies of data. In the time of failure, the controller use second disk to serve the data, thus making data availability continuous.
RAID Mirroring

When the failed disk is replaced with a new disk, the controller copies the data from the surviving disk of the mirrored pair. Data is simultaneously recorded on both the disk. Though this type of RAID gives you highest availability of data but it is costly as it requires double amount of disk space and thus increasing the cost.

3. Parity :
As explained above, mirroring involves high cost, so to protect the data new technique is used with striping called parity. This is reliable and low cost solution for data protection. In this method and additional HDD or disk is added to the stripe width to hold parity bit.
Parity is a redundancy check that ensures full protection of data without maintaining a full set of duplicate data.

RAID Parity

The parity bits are used to re-create the data at the time of failure. Parity information can be stored on separate, dedicated HDDs or distributed across all the drives in a RAID set. In the above image, parity is stored on a separate disk.
The first three disks, labeled D, contain the data. The fourth disk, labeled P, stores the parity information, which in this case is the sum of the elements in each row. Now, if one of the Disks (D) fails, the missing value can be calculated by subtracting the sum of the rest of the elements from the parity value.
Hope you have understood the basic of these RAID level. If you have any issue or concern, please let us know through your mails and comment.