0% found this document useful (0 votes)
88 views

Raid DBMS

Uploaded by

Julfikar asif
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
88 views

Raid DBMS

Uploaded by

Julfikar asif
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

RAID

A variety of disk-organization techniques, collectively called redundant arrays of independent


disks (RAID), have been proposed to achieve improved performance and reliability.

Why Raid?
Having a large number of disks in a system presents opportunities for improving the rate at
which data can be read or written, if the disks are operated in parallel. Parallelism can also be
used to perform several independent reads or writes in parallel. Furthermore, this setup offers the
potential for improving the reliability of data storage, because redundant information can be
stored on multiple disks. Thus, failure of one disk does not lead to loss of data.

RAID level 0 refers to disk arrays with striping at the level of blocks, but without any
redundancy (such as mirroring or parity bits). Figure 11.4a shows an array of size 4.

• RAID level 1 refers to disk mirroring with block striping. Figure 11.4b shows a mirrored
organization that holds four disks worth of data.

• RAID level 2, known as memory-style error-correcting-code (ECC) organization, employs


parity bits. Memory systems have long used parity bits for error detection and correction. Each
byte in a memory system may have a parity bit associated with it that records whether the
numbers of bits in the byte that are set to 1 is even (parity = 0) or odd (parity = 1). If one of the
bits in the byte gets damaged (either a 1 becomes a 0, or a 0 becomes a 1), the parity of the byte
changes and thus will not match the stored parity. Similarly, if the stored parity bit gets damaged,
it will not match the computed parity. Thus, all 1-bit errors will be detected by the memory
system. Error-correcting schemes store 2 or more extra bits, and can reconstruct the data if a
single bit gets damaged. The idea of error-correcting codes can be used directly in disk arrays by
striping bytes across disks. For example, the first bit of each byte could be stored in disk 1, the
second bit in disk 2, and so on until the eighth bit is stored in disk 8, and the error-correction bits
are stored in further disks. Figure 11.4c shows the level 2 scheme. The disks labeled P store the
error correction bits. If one of the disks fails, the remaining bits of the byte and the associated
error-correction bits can be read from other disks, and can be used to reconstruct the damaged
data. Figure 11.4c shows an array of size 4; note RAID level 2 requires only three disks’
overhead for four disks of data, unlike RAID level 1, which required four disks’ overhead.

Page 1 of 4 CSE 467 (RAID)


RAID level 3, bit-interleaved parity organization, improves on level 2 by exploiting the fact that
disk controllers, unlike memory systems, can detect whether a sector has been read correctly, so
a single parity bit can be used for error correction, as well as for detection. The idea is as follows.
If one of the sectors gets damaged, the system knows exactly which sector it is, and, for each bit
in the sector, the system can figure out whether it is a 1 or a 0 by computing the parity of the
corresponding bits from sectors in the other disks. If the parity of the remaining bits is equal to
the stored parity, the missing bit is 0; otherwise, it is 1.
RAID level 3 is as good as level 2, but is less expensive in the number of extra disks (it has only
a one-disk overhead), so level 2 is not used in practice. Figure 11.4d shows the level 3 scheme.
RAID level 3 has two benefits over level 1. It needs only one parity disk for several regular
disks, whereas Level 1 needs one mirror disk for every disk, and thus reduces the storage
overhead. Since reads and writes of a byte are spread out over multiple disks, with N-way
striping of data, the transfer rate for reading or writing a single block is N times faster than a
RAID level 1 organization using N-way striping. On the other hand, RAID level 3 supports a
lower number of I/O operations per second, since every disk has to participate in every I/O
request.

• RAID level 4, block-interleaved parity organization, uses block level striping, like RAID 0,
and in addition keeps a parity block on a separate disk for corresponding blocks from N other
Page 2 of 4 CSE 467 (RAID)
disks. This scheme is shown pictorially in Figure 11.4e. If one of the disks fails, the parity block
can be used with the corresponding blocks from the other disks to restore the blocks of the failed
disk.
A block read accesses only one disk, allowing other requests to be processed by the other disks.
Thus, the data-transfer rate for each access is slower, but multiple read accesses can proceed in
parallel, leading to a higher overall I/O rate. The transfer rates for large reads is high, since all
the disks can be read in parallel; large writes also have high transfer rates, since the data and
parity can be written in parallel.
Small independent writes, on the other hand, cannot be performed in parallel. A write of a block
has to access the disk on which the block is stored, as well as the parity disk, since the parity
block has to be updated. Moreover, both the old value of the parity block and the old value of the
block being written have to be read for the new parity to be computed. Thus, a single write
requires four disk accesses: two to read the two old blocks, and two to write the two blocks.

• RAID level 5, block-interleaved distributed parity, improves on level 4 by partitioning data and
parity among all N + 1 disks, instead of storing data in N disks and parity in one disk. In level 5,
all disks can participate in satisfying read requests, unlike RAID level 4, where the parity disk
cannot participate, so level 5 increases the total number of requests that can be met in a given
amount of time. For each set of N logical blocks, one of the disks stores the parity, and the other
N disks store the blocks.
Figure 11.4f shows the setup. The P’s are distributed across all the disks. For example, with an
array of 5 disks, the parity block, labelled Pk, for logical blocks 4k, 4k+1, 4k+2, 4k+3 is stored in
disk (k mod 5)+1; the corresponding blocks of the other four disks store the 4 data blocks 4k to
4k + 3. The following table indicates how the first 20 blocks, numbered 0 to 19, and their parity
blocks are laid out. The pattern shown gets repeated on further blocks.

RAID level 6, the P + Q redundancy scheme, is much like RAID level 5, but stores extra
redundant information to guard against multiple disk failures. Instead of using parity, level 6 uses
error-correcting codes such as the Reed– Solomon codes (see the bibliographical notes). In the
scheme in Figure 11.4g, 2 bits of redundant data are stored for every 4 bits of data—unlike 1
parity bit in level 5—and the system can tolerate two disk failures.

Choice of RAID Level


The factors to be taken into account when choosing a RAID level are
• Monetary cost of extra disk storage requirements
• Performance requirements in terms of number of I/O operations
• Performance when a disk has failed
• Performance during rebuild (that is, while the data in a failed disk is being
rebuilt on a new disk)
The time to rebuild the data of a failed disk can be significant, and varies with the RAID level
that is used. Rebuilding is easiest for RAID level 1, since data can be copied from another disk;
for the other levels, we need to access all the other disks in the array to rebuild data of a failed
disk. The rebuild performance of a RAID system may be an important factor if continuous
availability of data is required, as it is in high-performance database systems. Furthermore, since
rebuild time can form a significant part of the repair time, rebuild performance also influences
the mean time to data loss.
Page 3 of 4 CSE 467 (RAID)
2. For example, some products use RAID level 1 to refer to mirroring without striping, and level
1+0 or level 10 to refer to mirroring with striping. Such a distinction is not really necessary since
not striping can simply be viewed as a special case of striping, namely striping across 1 disk.

RAID level 0 is used in high-performance applications where data safety is not critical. Since
RAID levels 2 and 4 are subsumed by RAID levels 3 and 5, the choice of RAID levels is
restricted to the remaining levels. Bit striping (level 3) is rarely used since block striping (level
5) gives as good data transfer rates for large transfers, while using fewer disks for small transfers.
For small transfers, the disk access time dominates anyway, so the benefit of parallel reads
diminishes. In fact, level 3 may perform worse than level 5 for a small transfer, since the transfer
completes only when corresponding sectors on all disks have been fetched; the average latency
for the disk array thus becomes very close to the worst-case latency for a single disk, negating
the benefits of higher transfer rates. Level 6 is not supported currently by many RAID
implementations, but it offers better reliability than level 5 and can be used in applications where
data safety is very important.
The choice between RAID level 1 and level 5 is harder to make. RAID level 1 is popular for
applications such as storage of log files in a database system, since it offers the best write
performance. RAID level 5 has a lower storage overhead than level 1, but has a higher time
overhead for writes. For applications where data are read frequently, and written rarely, level 5 is
the preferred choice.
Disk storage capacities have been growing at a rate of over 50 percent per year for many years,
and the cost per byte has been falling at the same rate. As a result, for many existing database
applications with moderate storage requirements, the monetary cost of the extra disk storage
needed for mirroring has become relatively small (the extra monetary cost, however, remains a
significant issue for storage-intensive applications such as video data storage). Access speeds
have improved at a much slower rate (around a factor of 3 over 10 years), while the number of
I/O operations required per second has increased tremendously, particularly for Web application
servers.
RAID level 5, which increases the number of I/O operations needed to write a single logical
block, pays a significant time penalty in terms of write performance. RAID level 1 is therefore
the RAID level of choice for many applications with moderate storage requirements, and high
I/O requirements.
RAID system designers have to make several other decisions as well. For example, how many
disks should there be in an array? How many bits should be protected by each parity bit? If there
are more disks in an array, data-transfer rates are higher, but the system would be more
expensive. If there are more bits protected by a parity bit, the space overhead due to parity bits is
lower, but there is an increased chance that a second disk will fail before the first failed disk is
repaired, and that will result in data loss.

Page 4 of 4 CSE 467 (RAID)

You might also like