Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Understanding Striping, Redundancy, and RAID Levels in Database Management Systems, Slides of Introduction to Database Management Systems

An in-depth analysis of striping, redundancy units (data blocks and parity bits), and raid levels (0, 1, 1+0, 2, 3, 4, and 5) in database management systems. It covers the advantages, disadvantages, and recovery algorithms for each level, as well as the role of reliability groups and check disks.

Typology: Slides

2012/2013

Uploaded on 04/27/2013

prakash
prakash 🇮🇳

4.6

(10)

63 documents

1 / 31

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Database Management Systems Design
Docsity.com
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f

Partial preview of the text

Download Understanding Striping, Redundancy, and RAID Levels in Database Management Systems and more Slides Introduction to Database Management Systems in PDF only on Docsity!

Database Management Systems Design

Docsity.com

The problem with Striping

  • Striping has the advantage of speeding up disk access time.
  • But the use of a disk array decreases the reliability of the storage system because more disks mean more possible points of failure.
  • Mean-time-to-failure (MTTF)
    • Mean time to have the disk fail and lose its data
  • MTTF is inversely proportional to the number of components in used by the system. - The more we have the more likely they will fall apart!

Docsity.com

MTTF in a disk array

  • Suppose we have a single disk with a MTTF of 50,000 hrs (5.7 years).
  • Then, if we build an array with 50 disks, then we have a MTTF for the array of 50,000/50 = 1000 hrs, or 42 days!, because any disk can fail at any given time with equal probability. - Disk failures are more common when disks are new (bad disk from factory) or old (wear due to usage).
  • Morale of the story: More does not necessarily means better!

Docsity.com

Increasing MTTF with redundancy

  • We can increase the MTTF in a disk array by storing some redundant information in the disk array. - This information can be used to recover from a disk failure.
  • This information should be carefully selected so it can be used to reconstruct original data after a failure.
  • What to store as redundant information?
    • Full data block
    • Parity bit for a set of bit locations across all the disks
  • Where to store it?
    • Check disks – disks in the array used only for this purpose
    • All disks – spread redundant information on every disk in the array.

Docsity.com

Redundancy Unit: Parity bits

  • Consider an array of N disks. Suppose k is the number of the k-th block in each disk. Each block consists of several kilobytes, and each byte is 8-bit.
  • We can store redundant information about the i-th bit position in each data block. - Parity bit
  • The parity bit gives the number of bits that were set to the value 1 in the group of corresponding bit locations of the data blocks.
  • For example, if bit 1024 has a parity 0, then an even number of bits where set 1 at bit position 1024. Otherwise its value must be 1.

Docsity.com

Parity bits

  • Consider bytes:
    • b1 = 00010001, b2 = 00111111, b3 = 00000011
  • If we take the XOR these bytes we get 00010001 00111111 00000011 00101101 - this byte has the parity for all bits in b1, b2, b
  • Notice the following:
    • For bit position 0, the parity is 1,meaning an odd number of bits have value 1 for bit position 0.
    • For bit position 1, the parity is 0, meaning an even number of bits have value 1 for bit position 1

Docsity.com

Reliability groups in disk array

  • Organize the disks in the array into groups called reliability groups.
  • Each group has:
    • 1 or more data disks , where the data blocks are stored
    • 0 or more check disks where the blocks of parity bits are stored
  • If a data disk fails, then the check disk(s) for its reliability group can be used to recover the data lost from that disk.
  • There is a recovery algorithm that works for any failed disk m in the disk array.
  • Can recover from up to 1 disk failure.

Docsity.com

Recovery algorithm

  • Suppose we have an array of N disks, with M check disks (in this case there is one reliability group).
  • Suppose disk p fails. We buy a replacement and then we can recover the data as follows.
  • For each data block k on disk p:
    • Read data blocks k on every disk r, with r != p
    • Read parity block k from its check disk w
    • For each bit position i in block k of disk p:
      • Count number of bits set 1 at bit i in each block coming from a disk other than p. Let this number be j
      • If j is odd, and parity bit is 1 then bit position i is set to 0 Docsity.com

RAID Organization

• RAID:

  • Originally: Redundant Array of Inexpensive Disks
  • Now: Redundant Array of Independent Disks
  • RAID organization combines the ideas of striping, redundancy as parity bits, and reliability groups.
  • RAID system has one or more reliability groups
  • For simplicity we shall assume only one group …
  • RAID systems can have various number of check disks for reliability groups, depending on the RAID level that is chosen for the Docsity.com

RAID Analysis

  • Suppose we have a disk array with 4 data disks.
  • Let’s analyze how many check disks we need to build a RAID with 1 reliability group of 4 data disks plus the check disks.
  • Note: Effective space utilization is a measure of the amount of space in the disk array that is used to store data. It is given as a percentage by the formula:

Total Disksinthe Array

Effective SpaceUtilization = Data Disks

Docsity.com

RAID Level 1

  • RAID Level 1: Mirrored
  • Each data block is duplicated:
    • original copy + mirror copy
  • No striping!
  • Most expensive solution since it requires twice the space of the expected data set size.
  • Every write involves two writes (original + copy) - cannot be done simultaneously to prevent double corruption - First write on data disk, then on copy at mirrorDocsity.com

RAID Level 1 (cont…)

  • In RAID Level 1, the data block can be fetched from the disk with least contention.
  • Since we need to pair disks in groups of two (original + copy), the space utilization is 50%, independent on the amount of disks.
  • RAID Level 1 is only good for small data workloads where the cost of mirroring is not an issue.

Docsity.com

RAID Level 1+0 (cont…)

  • Space utilization is 50% (half data and half copies)
  • RAID Level 1+0 is better than RAID 1 because of striping.
  • RAID Level 1+0 is good for workloads with small data sets, where cost of mirroring is not an issue.
  • Also good for workloads with high percentages of writes, since a write is always 2Docsity.com

RAID Level 2

  • RAID Level 2: Error-Correcting Codes
  • Uses striping with a 1-bit striping unit.
  • Hamming code for redundancy in C check disks. - Can indicate which disk failed - Make number of check disk grow logarithmically with respect to the number of data disks. (???)
  • Read is expensive since to read 1 bit we need to read 1 physical data block, the one storing the bit. Docsity.com