Search CTRL + K

Redundant Array of Independent Disks

磁盘阵列(redundant array of independent disks, RAID) 是一种存储虚拟化技术,它将多块物理磁盘组合成一个或多个逻辑磁盘,增加数据冗余,以提高性能或可靠性,或者两者都有。

RAID 0

RAID 0 是将多块磁盘组合成一个大容量存储的方式,写数据时将数据分为 N 份,将每一份写入不同磁盘。因此理论上读写性能最高能到单块磁盘的 N 倍(N 为物理磁盘数量)。[1]

RAID 0 不提供数据校验、冗余备份,一旦磁盘损坏则数据丢失。

RAID 1

RAID 1 和 RAID 0 完全相反,写数据时将一份数据同时写入多个磁盘中,将多块磁盘当作一个磁盘用。它提供极高的数据可靠性,但性能不高。[1:1]

RAID 3

RAID 3 是一种兼顾了存储性能、数据可靠性和存储成本的方案,它按照 RAID 0 方式写入数据,同时用一块磁盘记录奇偶校验码,用于磁盘坏掉后的数据恢复。[1:2]

但是由于所有的写入都要更新记录奇偶校验码的磁盘,导致这块磁盘极易损坏,现在几乎不会使用 RAID 3。

RAID 5

RAID 5 是 RAID 3 的优化,是最常用的 RAID 方案。该方案将数据分为 N 份(N 为磁盘数量),并行写入 N 个磁盘中,同时将每个数据块的奇偶校验码写入到与数据块不同的磁盘中。[1:3]

当读取数据时,并发地从三块硬盘上读取,并通过奇偶校验码验证数据块,当某一块数据出现损坏,就可以通过另外两个硬盘块上的正确数据计算出损坏块的数据。

RAID 5 要求至少 3 块物理磁盘组成阵列。


Title

RAID ("redundant array of inexpensive disks" or "redundant array of independent disks") is a data storage virtualization technology that combines multiple physical disk drive components into one or more logical units for the purposes of data redundancy, performance improvement, or both. This is in contrast to the previous concept of highly reliable mainframe disk drives referred to as "single large expensive disk" (SLED).[2]

Database System Concepts p570

A variety of disk-organization techniques, collectively called redundant arrays of independent disks (RAID), have been proposed to achieve improved performance and reliability.[3]

Database System Concepts p570

The solution to the problem of reliability is to introduce redundancy; that is, we store extra information that is not needed normally but that can be used in the event of failure of a disk to rebuild the lost information.[3:1]

Database System Concepts p571

With multiple disks, we can improve the transfer rate as well (or instead) by striping data across multiple disks. In its simplest form, data striping consists of splitting the bits of each byte across multiple disks; such striping is called bit-level striping.[3:2]


  1. https://www.lacie.com/files/lacie-content/whitepaper/WP_RAID_zh.pdf ↩︎ ↩︎ ↩︎ ↩︎

  2. https://en.wikipedia.org/wiki/RAID ↩︎

  3. Silberschatz, Abraham, Henry F. Korth, and S. Sudarshan. Database System Concepts. Seventh edition. New York, NY: McGraw-Hill, 2020. ↩︎ ↩︎ ↩︎