Hardware

RAID 0 VS RAID 1

RAID or Redundant Array of Independent/Inexpensive Disks is a method of combining multiple physical disks to create a larger capacity logical disk (also known as a RAID array). It is also used to bring some redundancy to your data for protecting them against data loss due to hardware failure.

This article is about RAID 0 and RAID 1 and how they work so you will be able to decide which one to use.

RAID 0

The main reason to create a RAID array in the RAID level 0 configuration is to create a larger capacity disk using multiple smaller capacity disks.

The benefits of RAID level 0 are:

  • On a RAID 0 array, the data you store on the array will be spread evenly across all the disks of the array. So, the read and write speed of the array will be increased.
  • No disk space will be used for redundancy so you will be able to use the full capacity of the disks added to the RAID 0 array.

The problems of RAID level 0 are:

  • Since there is no redundancy in a RAID 0 array and data is spread across all the disks of the array, if any one of the physical disks fails, all the data you’ve stored on the RAID 0 array will be lost for good.

Working Principles of RAID 0

If you configure N number of x TB disks (Disk 1, Disk 2, Disk 3, and so on) in the RAID 0 configuration, you will get an xN TB RAID 0 array as you can see in the figure below.

For example, you can configure two 1 TB disks in the RAID 0 configuration to create a 2 TB RAID 0 array.

When you store files in a RAID 0 array, the file is broken into multiple chunks as you can see in the figure below.

The file chunks are then distributed among all the physical disks of the array. The RAID term for this method is stripping.

As data chunks are written to both of the physical disks simultaneously, the write performance will be increased.

When you read data from the RAID 0 array, data will be read from all the physical disks of the array. So, the read performance will be increased as well.

In a RAID 0 array, data is split between all the physical disks of the array. If one of the physical disks fails, part of all the files stored on the RAID 0 array is lost for good. So, no files will be recoverable in case a physical disk fails.

For example, let’s imagine a situation where you have a RAID 0 array with N disks. You’ve stored 2 files on the array.

If one of the disks (Disk 3 for example) fails, you will lose parts of both files and both of the files will be corrupted. You won’t be able to recover them.

RAID 1

The main reason to create a RAID array in the RAID level 1 configuration is to introduce redundancy to the array so that maximum data protection is achieved.

The benefits of RAID level 1 are:

  • On a RAID 1 array, the data you store on the array will be written to all the physical disks of the array so every one of the physical disks of the array will have the same data chunks.
  • Redundant data is written to all the physical disks of the RAID 1 array so your data is safe as long as at least one of the physical disks is okay.
  • All the physical disks of the array will have the same data chunks. So, when a file is read from the RAID 1 array, the data chunks of the file will be read from different physical disks. This improves the read speed of the array.
  • If a physical disk of the array fails, you can replace it with a new disk and it will be populated with an exact copy of the data existing in all the other disks of the array automatically.

The problems of RAID level 0 are:

  • All the physical disks of the RAID 1 array are used for redundancy so you will be able to use only one physical disk worth of disk space for data storage. The rest of the disk space will be used for data protection.
  • Unlike RAID 0, the write speed will be the same as that for a single physical disk of the array as the same data is written to all the disks of the array.

Working Principles of RAID 1

If you configure N number of x TB disks (Disk 1, Disk 2, Disk 3, and so on) in the RAID 1 configuration, you will get an x TB RAID 1 array as you can see in the figure below.

For example, you can configure two 1 TB disks in the RAID 1 configuration to create a 1 TB RAID 1 array.

When you store files in a RAID 1 array, the file is broken into multiple chunks as you can see in the figure below.

The same file chunks are then written to all the physical disks of the array. The RAID term for this method is mirroring.

As the same data chunks are written to both of the physical disks, the write performance will not improve. Write performance will be the same as that of one of the physical disks of the array.

When you read data from the RAID 1 array, data will be read from all the physical disks of the array. So, the read performance will be increased.

In a RAID 1 array, the same data chunks are written to all the physical disks of the array. If one of the physical disks fails, the same data is available on all the other disks so no data is lost.

For example, let’s imagine a situation where you have a RAID 1 array with N disks. You’ve stored 2 files on the array.

If one of the disks (Disk 3 for example) fails, you will still have the same files on the rest of the disks of the RAID 1 array. You won’t lose any data. As long as one of the disks of the array is okay, your data is safe.

Conclusion

RAID 0 on its own is mainly used for storing data that is not very important. On the other hand, RAID 1 is used for storing data that is very very important. Now that you know how RAID 0 and RAID 1 work, you should be able to decide which one you need depending on your data storage requirements.

About the author

Shahriar Shovon

Freelancer & Linux System Administrator. Also loves Web API development with Node.js and JavaScript. I was born in Bangladesh. I am currently studying Electronics and Communication Engineering at Khulna University of Engineering & Technology (KUET), one of the demanding public engineering universities of Bangladesh.