Raid
Raid
RAID
(Redundant Arrays of
Independent/Inexpensive Disks)
RAID is a technique that makes use of a combination of multiple disks instead of
using a single disk for increased performance, data redundancy, or both.
RAID is very transparent to the underlying system. This means, to the host
system, it appears as a single big disk presenting itself as a linear array of blocks.
This allows older technologies to be replaced by RAID without making too many
changes to the existing code.
Different RAID Levels
1. RAID-0 (Stripping)
2. RAID-1 (Mirroring)
3. RAID-2 (Bit-Level Stripping with Dedicated Parity)- Obsolete, no need to
discuss.
4. RAID-3 (Byte-Level Stripping with Dedicated Parity)
5. RAID-4 (Block-Level Stripping with Dedicated Parity)
6. RAID-5 (Block-Level Stripping with Distributed Parity)
7. RAID-6 (Block-Level Stripping with two Parity Bits)
1. RAID-0 (Stripping)
Instead of placing just one block into a disk at a time, we can work with two
(or more) blocks placed into a disk before moving on to the next one.
Evaluation
Reliability:0
There is no duplication of data. Hence, a block once lost cannot be recovered.
Capacity:N*B
The entire space is being used to store data. Since there is no duplication, N
disks each having B blocks are fully utilized.
Advantages
1. It is easy to implement.
2. It utilizes the storage capacity in a better way.
Disadvantages
1. A single drive loss can result in the complete failure of the system.
2. Not a good choice for a critical system.
2. RAID-1 (Mirroring)
More than one copy of each block is stored in a separate disk. Thus, every
block has two (or more) copies, lying on different disks.
The below figure shows a RAID-1 system with mirroring level 2.
RAID 0 was unable to tolerate any disk failure. But RAID 1 is capable of
reliability.
Evaluation
Assume a RAID system with mirroring level 2.
Reliability:1toN/2
1 disk failure can be handled for certain because blocks of that disk would have
duplicates on some other disk. If we are lucky enough and disks 0 and 2 fail,
then again this can be handled as the blocks of these disks have duplicates on
disks 1 and 3. So, in the best case, N/2 disk failures can be handled.
Capacity:N*B/2
Only half the space is being used to store data. The other half is just a mirror
of the already stored data.
Advantages
1. It covers complete redundancy.
2. It can increase data security and speed.
Disadvantages
1. It is highly expensive.
2. Storage capacity is less.
Here in the below figure, Disk 3 contains the Parity bits for Disk 0, Disk 1, and
Disk 2. If data loss occurs, we can construct it with Disk 3.
Advantages
1. Data can be transferred in bulk.
2. Data can be accessed in parallel.
Disadvantages
1. It requires an additional drive for parity.
2. In the case of small-size files, it performs slowly.
Parity is calculated using a simple XOR function. If the data bits are 0,0,0,1
the parity bit is XOR(0,0,0,1) = 1. If the data bits are 0,1,1,0 the parity bit is
XOR(0,1,1,0) = 0. A simple approach is that an even number of ones results in
parity 0, and an odd number of ones results in parity 1.
Assume that in the above figure, C3 is lost due to some disk failure. Then, we
can recompute the data bit stored in C3 by looking at the values of all the other
columns and the parity bit. This allows us to recover lost data.
Evaluation
Reliability: 1
RAID-4 allows recovery of at most 1 disk failure (because of the way parity
works). If more than one disk fails, there is no way to recover the data.
Capacity:(N-1)*B
One disk in the system is reserved for storing the parity. Hence, (N-1) disks
are made available for data storage, each disk having B blocks.
Advantages
1. It helps in reconstructing the data if at most one data is lost.
Disadvantages
1. It can’t help in reconstructing when more than one data is lost.
This is a slight modification of the RAID-4 system where the only difference
is that the parity rotates among the drives.
In the figure below, we can notice how the parity bit “rotates”.
This was introduced to make the random write performance better.
Evaluation
Reliability:1
RAID-5 allows recovery of at most 1 disk failure (because of the way parity
works). If more than one disk fails, there is no way to recover the data. This is
identical to RAID-4.
Capacity:(N-1)*B
Overall, space equivalent to one disk is utilized in storing the parity. Hence,
(N-1) disks are made available for data storage, each disk having B blocks.
Advantages
1. Data can be reconstructed using parity bits.
2. It makes the performance better.
Disadvantages
1. Its technology is complex and extra space is required.
2. If both discs get damaged, data will be lost forever.
Raid-6 helps when there is more than one disk failure. A pair of independent
parities are generated and stored on multiple disks at this level. Ideally, you
need four disk drives for this level.
There are also hybrid RAIDs, which make use of more than one RAID level
nested one after the other, to fulfill specific requirements.
Advantages
1. Very high data Accessibility.
2. Fast read data transactions.
Disadvantages
1. Due to double parity, it has slow write data transactions.
2. Extra space is required.
Advantages of RAID
1. Increased data reliability: RAID provides redundancy, which means that if
one disk fails, the data can be recovered from the remaining disks in the array.
This makes RAID a reliable storage solution for critical data.
2. Improved performance: RAID can improve performance by spreading data
across multiple disks. This allows multiple read/write operations to co-occur,
which can speed up data access.
3. Scalability: RAID can be scaled by adding more disks to the array. This means
that storage capacity can be increased without having to replace the entire
storage system.
4. Cost-effective: Some RAID configurations, such as RAID 0, can be
implemented with low-cost hardware. This makes RAID a cost-effective
solution for small businesses or home users.
Disadvantages of RAID
1. Cost: Some RAID configurations, such as RAID 5 or RAID 6, can be
expensive to implement. This is because they require additional hardware or
software to provide redundancy.
2. Performance limitations: Some RAID configurations, such as RAID 1 or
RAID 5, can have performance limitations. For example, RAID 1 can only
read data as fast as a single drive, while RAID 5 can have slower write speeds
due to the parity calculations required.
3. Complexity: RAID can be complex to set up and maintain. This is especially
true for more advanced configurations, such as RAID 5 or RAID 6.
4. Increased risk of data loss: While RAID provides redundancy, it is not a
substitute for proper backups. If multiple drives fail simultaneously, data loss
can still occur.