RAID Basics
What is RAID?
RAID (Redundant Array of Independent disks; originally Redundant Array of Inexpensive Disks) is a way of storing the same data in different places(redundantly) on multiple disks. By placing data on multiple disks, I/O operations can overlap in a balanced way, improving performance. Since multiple disks increases the mean time between failure (MTBF), storing data redundantly also increases fault-tolerance.
A RAID appears to the operating system to be a single logical hard disk. RAID employs the technique of striping, which involves partitioning each drive’s storage space into units ranging from a sector (512 bytes) up to several megabytes. The stripes of all the disks are interleaved and addressed in order.
To put in simplest form, RAID is set of disks configured in such a way that the operating system sees it as a single disk though in reality, the data is stored across multiple disks.
Why RAID?
As storage needs increase, it sometimes becomes necessary to put additional drives with larger capacities online.
The law of probability dictates that as the number of storage devices increases, so too does the likelihood of a device failure. Therefore, a system with a single hard drive is only 25% as likely to suffer a hardware failure as a system with four drives.
Fortunately, such failures can be handled gracefully, and more importantly without downtime. Redundancy and fault tolerance allow for automatic recovery of data should a device fail.
Basic RAID Levels
The RAID levels discussed are :
- RAID – 0
- RAID –1
- RAID – 2
- RAID – 3
- RAID – 4
- RAID – 5
RAID – 0
Popularly known as Spanned Volume 0r Striped Volume. In this RAID organization, multiple disks are configured as single volume. Even though you have more than one physical hard disk, operating system /application see it as a single disk. When you write a data into this volume, the data is striped across all the disks that constitute the RAID.
This is the simplest one among the all RAID levels, and does not have any disk redundancy. Files are broken into stripes of a size dictated by the user-defined stripe size of the array, and stripes are sent to each disk in the array. This RAID level has the best overall performance characteristics of all the basic RAID levels, especially for its cost. For this reason, it is becoming increasingly popular by performance-seekers, especially in the lower end of the marketplace. The major drawback of using RAID – 0 is obviously the fact that there is no data redundancy.
Working : One controller splits files into blocks or bytes and distributes them across several hard disks. The block size determines into how many “pieces” the files will be split into. Consider the case shown in the figure below.The first block of file 1 is sent to disk #1, then the second block to disk #2, etc. When all four disks have one block of file 1, the fifth block goes back to disk #1, and this continues until the file is completed. Notice that file 3 is only on one disk because it is smaller than the block size.
| Figure1.0 |
Technique: Striping (without parity)
Minimum disks required: 2 disks
Storage Efficiency: 100% of the disk capacity (because there is no redundancy).
Fault Tolerance: None. Failure of any drive results in loss of all data, short of specialized data recovery.
Special Considerations: Using a RAID-0 array without backing up any changes made to its data is a loud statement that that data is not important to you.
Recommended Uses: Non-critical data (or data that changes infrequently and is backed up regularly) requiring high speed, particularly write speed, and low cost of implementation.
- Audio and video streaming and editing
- web servers
- graphic design
- high-end gaming or hobbyist systems
- temporary or “scratch” disks on larger machines
RAID – 1
Popularly known as Mirrored Volume 0r Duplexed Volume. As the name suggest, the data is mirrored in the array of disks for the complete redundancy. Mirroring is one of the data redundancy techniques used in RAID. Using mirroring, all the data in the system is written simultaneously onto two hard disks instead of one; thus the “mirror” concept. Mirroring provides 100% data redundancy and thus full protection against the failure of either of the disks. Mirroring setups always require an even number of drives for obvious reasons.
In this RAID organization, if one of the disks fails, an exact replica copy id available on the other disk. If either one of the drive fails, the other continues to function as a single drive until the failed drive is replaced. Conceptually simple, RAID 1 is popular for those who require fault tolerance and don’t need top-notch read performance. Whenever you write a data it is written in to both disks (mirrored copy) and hence the write speed is low.
Duplicate writing of data can be achieved by using either a single controller to do the write operations on both the disks (Mirroring – Single controller) or by usingtwo different controllers (Duplexing – double controller). Except for the difference in number of controllers used, both mirroring and duplexing are same in terms of RAID levels.
| Mirroring |
| Duplexing |
| Figure 1.1 |
Write pattern of RAID-1
| Figure 1.2 |
Technique: Mirroring or Duplexing
Minimum disks required: 2 disks (or in multiples of two)
Storage Efficiency: 50% of minimum capacity disk
Fault Tolerance: Very good; Duplexing is even better.
Special Considerations: RAID 1 arrays are limited to the size of the drives used in the array. Multiple RAID 1 arrays can be set up if additional storage is required. Performance may be reduced if implemented using software controller instead of a hardware controller. Duplexing may require software RAID and thus may show lower performance than mirroring.
Recommended Uses:
Applications requiring high fault tolerance at a low cost, without heavy emphasis on large amounts of storage capacity or top performance. Especially useful in situations where the perception is that having a duplicated set of data is more secure than using parity. For this reason, RAID 1 is popular for accounting and other financial data. It is also commonly used for small database systems, enterprise servers, and for individual users requiring fault tolerance with a minimum of hassle and cost.
RAID – 2
This raid level is present only in concept or in theory. It is practically hard to find out the usage of this. Level 2 is the “black sheep” of the RAID family, because it is the only RAID level that does not use one or more of the “standard” techniques of mirroring, striping and/or parity. RAID 2 uses something similar to striping with parity, but not the same as what is used by RAID levels 3 or 5. It is implemented by splitting data at the bit level and spreading it over a number of data disks and a number of redundancy disks. The redundant bits are calculated using Hamming codes, a form of error correcting code (ECC). Each time something is to be written to the array these codes are calculated and written along side the data to dedicated ECC disks. When the data is read back, these ECC codes are read as well, to confirm that no errors have occurred since the data was written. If a single-bit error occurs, it can be corrected “on the fly”. This is similar to the way ECC is used within hard disks today. It’s also the same concept used for ECC protection of system memory.
It is expensive and often requires many drives. The controllers required was complex, specialized and expensive. The performance of RAID 2 is also rather substandard in transactional environments due to the bit-level striping. But most of all, level 2 was obviated by the use of ECC within a hard disk. Essentially, much of what RAID 2 provides you, is now there for “free” within each hard disk, with other RAID levels providing protection above and beyond ECC.
Due to its cost and complexity, level 2 never really “caught on”. Therefore, much of the information below is based upon theoretical analysis, not empirical evidence.
Technique: Bit-level striping with Hamming code ECC.
Minimum disks required: Depends on exact implementation, but a typical setup requires 10 data disks and 4 ECC disks for a total of 14, or 32 data disks and 7 ECC disks for a total of 39! The disks are usually spindle-synchronized to run in tandem.
Storage Efficiency: Depends on the number of data and ECC disks; for the 10+4 configuration, storage efficiency is about 71%
Fault Tolerance: Fair; for all the redundant drives included, you don’t get much tolerance: only one drive can fail in this setup and be recoverable “on the fly”.
Special Considerations: Not used in modern systems.
Recommended Uses: Not used in modern systems.
RAID – 3
Popularly known as Stripe Volume with dedicated Parity. In RAID 3, data is striped across multiple disks at a byte level and the parity information is sent to a dedicated parity disk, but the failure of any disk in the array can be tolerated (i.e., the dedicated parity disk doesn’t represent a single point of failure in the array.) The dedicated parity disk does generally serve as a performance bottleneck, especially for random writes, because it must be accessed any time anything is sent to the array.
It is one step ahead of the RAID-0 where there is no redundancy. That part of redundancy is achieved through the parity technique.
Technique: Byte-level striping with dedicated parity.
Minimum disks required: Minimum of 3 standard hard disks
Storage Efficiency: If all drives are of the same size, Storage Efficiency = ((Number of Drives – 1) / Number of Drives).
Fault Tolerance: Good. Can tolerate loss of one drive.
Special Considerations: Not as popular as many of the other commonly implemented RAID levels. For transactional environments, RAID 5 is usually a better choice.
Recommended Uses: Applications working with large files that require high transfer performance with redundancy, especially serving or editing large files: multimedia, publishing and so on. RAID 3 is often used for the same sorts of applications that would typically see the use of RAID 0, where the lack of fault tolerance of RAID 0 makes it unacceptable.
RAID – 4
This is similar to the RAID-3 except that it stripes data across many disks in blocks. This RAID level is not used often and only followed by some RAID vendors as proprietary to their product. Generally RAID-5 is used instead of this.
RAID-4 is some where in between the closer RAID levels 3 and 5. It is like RAID 3 except that it uses blocks instead of bytes for striping, and like RAID-5 except that it uses dedicated parity instead of distributed parity. Going from byte to block striping improves random access performance compared to RAID-3, but the dedicated parity disk remains a bottleneck, especially for random write performance. Fault tolerance, format efficiency and many other attributes are the same as for RAID-3 and RAID-5.
Technique: Block-level striping with dedicated parity.
Minimum disks required: Minimum of 3 standard hard disks
Storage Efficiency: If all drives are of the same size, Storage Efficiency = ((Number of Drives – 1) / Number of Drives).
Fault Tolerance: Good. Can tolerate loss of one drive.
Special Considerations: Performance will depend to some extent upon the stripe size chosen.
Recommended Uses: Jack of all trades and master of none, RAID 4 is not as commonly used as RAID 3 and RAID 5, because it is in some ways a “compromise” between them that doesn’t have a target market as well defined as either of those two levels. It is sometimes used by applications commonly seen using RAID 3 or RAID 5, running the gamut from databases and enterprise planning systems to serving large multimedia files.
RAID – 5
This is one of the most popular RAID levels, RAID 5 stripes both data and parity information across three or more drives. It is similar to RAID 4 except that it exchanges the dedicated parity drive for a distributed parity algorithm, writing data and parity blocks across all the drives in the array. This removes the “bottleneck” that the dedicated parity drive represents, improving write performance slightly and allowing somewhat better parallelism in a multiple-transaction environment, though the overhead necessary in dealing with the parity continues to bog down writes. Fault tolerance is maintained by ensuring that the parity information for any given block of data is placed on a drive separate from those used to store the data itself. The performance of a RAID 5 array can be “adjusted” by trying different stripe sizes until one is found that is well-matched to the application being used.
Unlike the RAID 3, this uses the distributed parity and hence the risk of continuous access of single parity disk is taken care. This makes the risk balanced with both data drive and the parity drive.
Technique: Block-level striping with distributed parity..
Minimum disks required: Minimum of 3 standard hard disks
Storage Efficiency: If all drives are the same size ((Number of Drives – 1) / Number of Drives).
Fault Tolerance: Good. Can tolerate loss of one drive.
Special Considerations: Due to the amount of parity calculating required, software RAID 5 can seriously slow down a system. Performance will depend to some extent upon the stripe size chosen.
Recommended Uses: RAID 5 is seen by many as the ideal combination of good performance, good fault tolerance and high capacity and storage efficiency. It is best suited for transaction processing and is often used for “general purpose” service, as well as for relational database applications, enterprise resource planning and other business systems. For write-intensive applications, RAID 1 or RAID 1+0 are probably better choices (albeit higher in terms of hardware cost), as the performance of RAID 5 will begin to substantially decrease in a write-heavy environment.
Advanced RAID Levels
Advanced RAID levels are nothing but the basic raid levels combined to get better efficiency, availability and fault tolerance. Can I call it “Nested RAID or Multiple RAID”? ( I think you can)As it is a combination of basic raids. Using the basic elementary mathematics, performance enhancing and more reliable systems are derived in this.
A multiple RAID level is generally created by taking a number of disks and dividing them into sets. Within each set a single RAID level is applied to form a number of arrays. Then, the second RAID level is applied to the arrays to create a higher-level array. Since there are two levels, there are two ways they can be combined. The choice of which level is applied first and which second, has an impact on some important array characteristics. Based on choice of the first level, the naming convention changes.
The standard that most of the industry seems to use is that if RAID level X is applied first and then RAID level Y is applied over it, it is called RAID “X+Y”or “RAID XY” or “RAID X/Y”. All these refer to the same RAID level, it is just that different people follow different way of representation.
Now the question arises if there is any difference between RAID “Y+X” and RAID “X+Y”? If you have ten marbles, why would you care if they are arranged in five columns and two rows (5 * 2), or two columns and five rows (2 * 5)? Same here: aren’t ten disks in an array represent ten marbles?
In many respects, there is no difference between them: there is no impact on drive requirements, capacity, storage efficiency, and importantly, not much impact on performance. The big difference comes into play when we look at fault tolerance. Most controllers implement multiple level RAID by forming a “super array” comprised of “sub-arrays” underneath it. In many cases the arrays that comprise the “super array”–often called sets–are considered to be logical “single units”, which means that the controller only considers one of these “single units” to either be “up” or “down” as a whole. It will make use of redundancy features within a sub-array, but not between sub-arrays, even if the higher-level array means that drives in different sub-arrays will have the same data.


