RAID Levels and Types
In simple terms, RAID is basically a way of combining a group of hard drives together to form a single “virtual” drive. The main benefit is not only to obtain a bigger combined space but also to have data protection by having redundancy. This redundancy is achieved by duplicating the data in the additional drives, therefore, if one drive fails your data will still be safe and available. In a nutshell, RAID provides two main advantages: performance and/or data redundancy. In the following article I will be talking about the different RAID levels, their advantages and disadvantages. I will only focus on the RAID levels that are being used today, not in rare or obsolete ones like RAID 2, 3, and 4. The purpose of this article is to help you get a quick understanding of what RAID is and what level to choose for your project.
RAID Types
There are two ways RAID can be implemented:
Software RAID: In “Software RAID”, all the configuration is handled by the operating system. The advantage of software RAID is that it is very cheap, since you do not have to buy extra hardware and the software to manage the RAID is included with most operating systems. One disadvantage is that since it is not managed by it own hardware, it takes resources away from the computer.
Hardware RAID: In “Hardware RAID”, all information regarding your specific RAID configuration is handled by a hardware interface card. The main advantage if this implementation is improved performance. Since everything is handled by the interface card, the computer does no have to use memory or CPU power to run the RAID.
Note: In the past, hardware RAID was always the preferred choice, however in todays world of multi-core CPUs and affordable memory, opinion is increasingly shifting. With faster CPUs, software RAID can perform as good as hardware RAID and even faster in some instances.
RAID Levels
Once you choose what RAID type you will be implementing, you have to choose the RAID level. The RAID level is basically the way you configure your drives. All levels have their advantages and disadvantages. Some are good for space but not for protection; others are good for protection but not for performance, etc. There is no “better” for all situations. Each of the choices listed below can be the “Best” for your specific situation. It is up to you to determine which, so read the article and choose wisely.
Raid 0
With RAID 0, you have two or more drives acting as if they were one single drive. Raid 0, however, offers “0” protection. In fact since you have two hard drives involved, you have twice the risk of losing your data, since it only takes one of them going bad to lose it all.
Advantages:
– Since it has no redundancy, RAID 0 uses hard drive space to it maximum.
– Speed.
Disadvantages:
– No protection; if you lose one single hard drive, your data is gone.
– Since you are using two hard drives with no redundancy, you are doubling your risk. It will actually be safer to store your data in a single hard drive of equal size.
When to use:
Raid 0 is for people that need space but do not care about losing their data. So in what case would it be beneficial to use RAID 0?. A good example could be a cheap backup server. Let’s say you have a bunch of old drives sitting around gathering dust. You need to back up your data, but none of them is big enough for the job. Put them all together to form a RAID 0 array and use their combined space. Just make sure the data that goes into this server is strictly for backup purposes.
Raid 1
In RAID 1 hard drives are mirrors of each other. This provides redundancy in case one of them happens to fail. Unlike RAID 0 where the total combined space of the drives is used, RAID 1 only uses half of the space, since the second drive is used for redundancy. Both hard drives have to be of equal sizes.
Advantages:
– Redundancy.
– Speed.
Disadvantages:
– Space is not used efficiently. Since both drives are copies of each other, only half of the total combined size is used.
When to use:
Since RAID 1 is not good for space but rather good for speed and redundancy, it is good option for running the operating system. Servers usually have two RAID levels: a RAID 1 array which contains the operating system only and, and a second level of RAID (usually RAID 5) for storage.
RAID 5
RAID 5 is probably the most popular level used in servers today. With RAID 5 you have a trade off between performance and efficient use of space. In RAID 5 redundancy is distributed among all drives and only one can break at a time. The minimum number of drives that can be used in RAID 5 is three.
Advantages:
– Efficient use ot total combined space.
– Fault tolerance: If you lose one drive your data is still safe.
Disadvantages:
– Speed: RAID 5 is not as fast as RAID 0 or 1
– If you lose more that one drive at the same time, your data is gone.
When to use:
This RAID level is usually the best for storing data, since it makes an efficient use of the total combined space and provides data redundancy.
RAID 6
Basically the same as RAID 5 with the differece that two drives can be down at the same time instead of just one. The minimum number of drives that can be used with RAID 6 is four.
Advantages:
– Two drives can break at the same time and your data is still safe.
Disadvantages:
– Since two drives are used for parity, the total combined hard drive space is greatly reduced.
– Speed. RAID 6 is not as fast as RAID 0 or 1
– Slower rebuilds: When a drive goes down and the array needs to be rebuilt, performance will decrease considerably when compared to other RAID methods.
When to use:
Good to use for high-availability storage space. RAID 6 is basically the same as RAID 5 with increased data security. Not good if you want the most space you can get out of your drives since you will probably lose 40% of the total combined space.
RAID Z
Raid Z and RAID Z2 are the invention of Sun Micro Systems. RAID Z has all the benefits of RAID 5 and many other features which makes it far superior. As with RAID 5, RAID Z can support a number of hard drives working together and one for parity. The minimum number of hard drives you can have is three and only one of them can be down at a time. If more than one hard drive breaks at the same time, your data is gone.
Advantages:
– Has all the benefits of RAID 5 and many other features.
Disadvantages:
– Can only be used with Solaris based OSs like Open Solaris or Nexenta and BSD based systems like FreeBSD.
When to use:
RAID Z is without a doubt the best RAID level for storage. It basically overcomes almost all of the shortcomings of earlier RAID levels and adds many new features; however, since it can only be used with Solaris and BSD based systems, it is best for use in NAS and other large data storage devices.
RAID Z2
Raid Z2 is almost identical to Raid Z and similar to RAID 6. In RAID Z2, two hard drives can go down at the same time and your data will still be safe and accessible. Just like with RAID Z, RAID Z2 is vastly superior to RAID 6 as it includes many other features. The minimum amount of drives you can have with RAID Z2 is four.
Advantages:
– Your data is safer since two drives can be down at the same time instead of just one.
– It has all the benefits of RAID Z.
Disadvantages:
– Since two drives are used for parity, the total combined size of the space is greatly reduced.
– Can only be used with Solaris based OSs like Open Solaris or Nexenta and BSD based systems like FreeBSD.
When to use:
Same as RAID Z but with an added level of security. Not good if you want the most space you can get out of your drives.