Friday, June 23, 2006

RAID: Redundant Array of Inexpensive Disks

RAID 0
  • not an original RAID level
  • aka striped set (data is striped across multiple disks)
  • data is splitted evenly across multiple (two or more) disks
  • not redundant
  • uses
    • increases performance
    • can create a large virtual disk from many small physical disks
  • disks of multiple size can be used
    • only the size of the smallest disk will be added to the array
  • I/O operations are splitted into blocks of equal size and spread across the disks evenly
  • reliability (MTTF = Mean Time to Failure) (MTBF = Mean Time Between Failure)
    • = average reliability of each disk / number of disks in the array
    • inversely proportional to number of disks
    • two disk array ~ half reliable than a single disk
    • Why?
      • FS (Filesystem distributed across all disks)
  • Data recovery
    • possible with the help of specialized tools
      • incomplete
      • possibly corrupt
  • Useful
    • read-only NFS servers
    • redundancy is not needed (data integrity not important)
    • when number of disks is limited
      • Windows can only have 24 hard drives
    • useful for systems where performance is required (gaming)
RAID 1
  • data is mirrored on two or more disks
  • data capacity is less important than read performance
  • the smallest disk in the set dictates the size of the array
  • reliability increases exponentially as compared to single disk
  • RAID 1 array of multiple (four) drives can read in all four different places at the same time.
    • all drives can be accessed independently
  • splitting / duplexing
    • independent disk controllers for each disk
      • maximizes performance benefits
    • the requested sectors can be splitted across multiple disks to keep the seek time low and to double the transfer rate. If we have three disks the transfer rate can be tripled.
RAID 5
  • Block level striping
  • Data distributed across all member disks
  • low cost of redundancy
  • hardware support for parity calculations generally needed
  • Read requests for the blocks on the same drive cannot be done concurrently and will have to wait
  • Read requests for data blocks on different drives can be accessed concurrently.
  • A block consists of many consecutive sectors on a disk.
  • A stripe is a block from each member disk (series of blocks)
  • distributed parity block
    • disk used for the parity block "is staggered from one stripe to the next"
  • RAID 5 writes
    • expensive (disk operations and traffic between disk and the controller)
  • Parity blocks
    • not read on data reads
      • as it results in reduced performance
    • read when a read of data sector raises a CRC error.
      • the errant sector can be reconstructed
  • Interim Data Recovery Mode
    • In the event of disk failure
      • data can be reconstructured "on the fly" by mathematically combining the parity blocks from the remaining disks
    • RAID 5 may be faster than RAID 4 in this mode.
    • If we have single parity block per stripe
      • failure of a drive = total loss.
RAID 10
  • Primary choice for databases with high-load
    • because lack of parity to calculate allows for faster write speeds
  • aka RAID 1+0, or RAID 1&0
  • similar to RAID 0+1
    • RAID levels used are reversed.
  • stripe of mirrors
  • From each RAID 1, all except one drive could fail and the data won't be damaged.
    • if the failed drives aren't replaced then the working hard drive becomes the single point of failure.
  • capacity
    • (size of smallest drive * even number of drives )/ 2
References:
Wikipedia: RAID