Raid
Raid
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.
FIRST KNOW DATA
REDUNDANCY!
Data redundancy refers to situations where the same piece of information is stored in multiple
locations. This can happen within a single database, across different software systems, or even
in physical files.
This can be intentional, for purposes like backup and disaster recovery. But it can also be
unintentional, due to inefficiencies or errors in data management.
As an intentional measure, although taking up extra space, adds to disk reliability. This means,
that in case of disk failure, if the same data is also backed up onto another disk, we can
retrieve the data and go on with the operation.
On the other hand, if the data is spread across multiple disks without the RAID technique, the
loss of a single disk can affect the entire data! GONE…..
DIFFERENT RAID LEVELS
RAID-0 (Stripping)
RAID-1 (Mirroring)
RAID-2 (Bit-Level Stripping with Dedicated Parity)
RAID-3 (Byte-Level Stripping with Dedicated Parity)
RAID-4 (Block-Level Stripping with Dedicated Parity)
RAID-5 (Block-Level Stripping with Distributed Parity)
RAID-6 (Block-Level Stripping with two Parity Bits)
RAID-0 (STRIPPING)
BLOCKS ARE “STRIPPED”
ACROSS DISKS.
RAID-0 (Stripping)
• Blocks are “stripped” across disks.
RIAD 0 CHARACTERISTICS
Reliability: 0
No REDUNDANCY : There is no duplication of data. Hence, a block once lost cannot be
recovered.
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.
ABOUT: RAID 1
Advantages
It covers complete redundancy.
It can increase data security and speed.
Disadvantages
It is highly expensive.
Storage capacity is less.
RAID 2: BIT-LEVEL STRIPPING
WITH DEDICATED PARITY)
In Raid-2, the error of the data is checked at every bit level. Here, we use Hamming Code
Parity Method to find the error in the data.
It uses one designated drive to store parity.
• The structure of Raid-2 is very complex as we use two disks in this technique. One word
is used to store bits of each word and another word is used to store error code correction.
• It is not commonly used.
RAID-3: (BYTE-LEVEL
STRIPPING WITH DEDICATED
PARITY)
It consists of byte-level striping with dedicated parity striping.
At this level, we store parity information in a disc section and write to a dedicated parity drive.
Whenever failure of the drive occurs, it helps in accessing the parity drive, through which we
can reconstruct the data. Here 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.
WHENEVER FAILURE OF THE DRIVE OCCURS, IT HELPS IN
ACCESSING THE PARITY DRIVE, THROUGH WHICH WE
CAN RECONSTRUCT THE DATA. HERE 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.
RAID-4 (BLOCK-LEVEL
STRIPPING WITH DEDICATED
PARITY)
Instead of duplicating data, this adopts a parity-based approach.
ABOUT: RAID 4
RAID 4 uses a specific type of checksum called an XOR (Exclusive OR) checksum for data
integrity
Striping and Parity: RAID 4 splits data into stripes (blocks) and distributes them across all drives
except for one dedicated parity drive.
XOR Operation: During a write operation, the RAID controller performs an XOR operation on
each data block in the stripe. The XOR operation essentially compares bits between
corresponding data blocks.
If both bits are the same (0 or 1), the result is 0.
If the bits are different (0 and 1, or 1 and 0), the result is 1.
Storing Parity: The result of the XOR operation for each data block is stored on the dedicated
parity drive. This essentially creates a "check" value for the entire stripe.
Disadvantages
It can’t help in reconstructing when more than one data is lost.
RAID-5 (BLOCK-LEVEL STRIPPING WITH
DISTRIBUTED PARITY)
. 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, we can notice how the parity bit “rotates”.
This was introduced to make the random write performance better.
ABOUT: RAID 5
Advantages
Data can be reconstructed using parity bits.
It makes the performance better.
Disadvantages
Its technology is complex and extra space is required.
If both discs get damaged, data will be lost forever.
RAID-6 (BLOCK-LEVEL
STRIPPING WITH TWO PARITY
BITS)
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.
ABOUT RAID 6
Advantages
Very high data Accessibility.
Fast read data transactions.
Disadvantages
Due to double parity, it has slow write data transactions.
Extra space is required.
CONCLUSION
In Conclusion, RAID technology in database management systems or in any system
management environment : distributes and replicates data across several drives to improve
data performance and reliability. It is a useful tool in contemporary database setups since it is
essential to preserving system availability and protecting sensitive data.