Technology

RAID levels explained and how to choose

Get to know RAID 0/1/5/10 levels; understand the difference between speed and redundancy, recognize common mistakes, and learn why RAID is never a substitute for backup.

Technology

What is RAID and Why Does Choosing Its Level Matter?

RAID (an acronym for Redundant Array of Independent Disks) is a technique that combines multiple physical disks into a single logical unit to either increase read/write speed, provide resilience against disk failure, or both. In data centers and enterprise servers, choosing the RAID level is one of the infrastructure decisions that directly impacts performance, cost, and the risk of data loss.

Many system administrators assume that a higher RAID level is always better; however, this belief is incorrect. Each RAID level represents a trade-off between three main factors: speed, usable capacity, and fault tolerance. In this article, we will focus on the four most commonly used levels — RAID 0, RAID 1, RAID 5, and RAID 10 — examine real-world scenarios, and finally answer the question of why RAID is not a substitute for backup.

RAID 0: Pure Speed, No Security

RAID 0 distributes data across two or more disks using striping. This means data blocks are divided into smaller pieces and written simultaneously across different disks. The result is a significant increase in read and write speed, especially for video applications and processing large volumes of data.

Technical Specifications of RAID 0

  • Minimum number of disks: 2
  • Usable capacity: 100% of the total disk capacity
  • Fault tolerance: None — if any disk fails, the entire array is lost
  • Suitable use cases: Temporary cache, video rendering, test environments

Suppose you have two 1 TB disks. In RAID 0, the final capacity will be 2 TB, and write speed will almost double compared to a single disk. However, if one disk fails, not only is the data on that disk lost, but all data in the array is lost as well, because the blocks of a file are spread across both disks.

Common mistake: Using RAID 0 for production databases. If your database is on RAID 0 and a disk fails, not only is the data lost, but the file system structure may be completely destroyed, making recovery impossible even with professional tools.

RAID 1: Simple and Reliable Mirroring

RAID 1 copies data simultaneously to two or more disks (mirroring). Every byte written to the first disk is also written exactly to the second disk. If one disk fails, the other disk continues to operate, and the system keeps running without interruption.

Technical Specifications of RAID 1

  • Minimum number of disks: 2
  • Usable capacity: 50% of the total disk capacity
  • Fault tolerance: Failure of one disk (in a two-disk array)
  • Suitable use cases: Server operating system, critical files, small databases

Read speed improves in RAID 1 because the controller can read from both disks in parallel. However, write speed is roughly equal to that of a single disk, since every write must be performed on both disks. The cost of this level is high; for 1 TB of usable space, you need 2 TB of disk capacity.

Important note: RAID 1 with two disks only protects against the failure of one disk. If both disks fail simultaneously (e.g., due to a power surge or controller error), the data is lost.

RAID 5: Balance Between Capacity and Security

RAID 5 distributes data using striping while also spreading parity information across the disks. This parity information is calculated in such a way that if one disk fails, its data can be reconstructed from the data on the other disks.

Technical Specifications of RAID 5

  • Minimum number of disks: 3
  • Usable capacity: (Number of disks − 1) × capacity of each disk
  • Fault tolerance: Failure of one disk
  • Suitable use cases: File servers, data archives, general-purpose environments

With three 1 TB disks, the final capacity will be 2 TB. Read speed is good, but write speed is lower than RAID 0 because parity information must be calculated and written for every write operation. These calculations are performed by the RAID controller, and in the case of software RAID, the processing load falls on the server's CPU.

Important warning: RAID 5 with large disks (over 4 TB) carries a high risk. During a rebuild after a disk failure, there is a possibility that a second disk may fail due to high read pressure. If the second disk fails, the entire array is lost. For large disks, RAID 6 or RAID 10 are better options.

RAID 10: Combining Speed and Redundancy

RAID 10 (also known as RAID 1+0) is a combination of mirroring and striping. First, disks are organized into mirrored pairs (RAID 1), and then data is striped across these pairs (RAID 0). The result is both high speed and good fault tolerance.

Technical Specifications of RAID 10

  • Minimum number of disks: 4 (two mirrored pairs)
  • Usable capacity: 50% of the total disk capacity
  • Fault tolerance: Failure of one disk in each mirrored pair (in the best case, up to half of the disks)
  • Suitable use cases: High-transaction databases, mail servers, virtualization

With four 1 TB disks, the final capacity is 2 TB. Both read and write speeds are high because writes are performed in parallel across the mirrored pairs. If the first disk fails, its mirrored pair continues to operate, and the rebuild is faster than RAID 5 because only the data from that pair needs to be copied, not parity calculations.

Real-world example: In a MySQL database with heavy transactions, using RAID 10 with four SSD disks can increase transactions per second (TPS) by 30 to 40 percent compared to RAID 5 with the same disks, because write latency is reduced due to the absence of parity calculations.

Quick Comparison Table of RAID Levels

FeatureRAID 0RAID 1RAID 5RAID 10
Minimum disks2234
Usable capacity100%50%(n−1)/n50%
Fault toleranceNone1 disk1 disk1 disk per pair
Read speedExcellentGoodGoodExcellent
Write speedExcellentModerateModerateExcellent
Cost per gigabyteLowHighModerateHigh

How to Choose the Right RAID Level?

Choosing a RAID level depends on your workload requirements, not on one option being "the best." Ask yourself the following questions:

  1. Is the data critical? If yes, set RAID 0 aside. For critical data, choose RAID 1 or RAID 10.
  2. Is write speed more important or capacity? If you have a high-transaction database, RAID 10 is the best option. If you only need a lot of space and speed is less important, RAID 5 (with smaller disks) or RAID 6 is suitable.
  3. What is your budget? RAID 10 requires twice the number of disks. If your budget is limited and the data is not highly critical, RAID 5 with three disks can provide a good balance.
  4. Are you using hardware or software RAID? Hardware RAID with a dedicated controller (such as LSI or Adaptec) offers better performance and reduces CPU load. Software RAID (such as mdadm in Linux) is cheaper, but for RAID 5 with large disks, parity calculations can saturate the CPU.

Practical example: For a web server serving static files, RAID 5 with three 2 TB disks is an economical and reliable option. However, for a PostgreSQL database server processing thousands of transactions per second, RAID 10 with four SSD disks is the more professional choice, even if it costs more.

Common Mistakes in RAID Implementation

During years of working as a system administrator, I have repeatedly seen several mistakes that have led to data loss:

  • Using heterogeneous disks in one array: Combining disks with different speeds (e.g., 7200 RPM and 10000 RPM) limits the performance of the entire array to the slowest disk and increases the risk of premature failure.
  • Ignoring the RAID controller battery or capacitor: If your RAID controller has cache and its battery is faulty, data in the cache will be lost during a power outage. This can lead to file system corruption.
  • Forgetting monitoring: RAID does not alert you unless you configure monitoring tools. If a disk fails and you do not notice, the array operates in a degraded state, and with the failure of a second disk, everything is lost.

Why RAID Is Not a Substitute for Backup?

This is the most important point of this article. RAID protects you against disk failure, but it does nothing in the following cases:

  • Accidental deletion of files: If you accidentally delete a file, RAID will not restore it. Mirroring is only a real-time copy, not a history.
  • Malware and ransomware: If ransomware encrypts your files, RAID will copy those encrypted files across all disks.
  • Human or software errors: A mistaken command like rm -rf / or a software bug can destroy data across all disks in the array.
  • Fire, theft, or natural disasters: If the entire server is lost, RAID provides no help.

The correct solution is to combine RAID with a regular backup strategy. Remember the 3-2-1 rule: 3 copies of your data, on 2 different media, with 1 copy kept off-site. For off-site backups, you can use cloud storage. Companies like ServerNet offer hosting services and cloud space that can be a suitable destination for off-site backups; however, in any case, the final choice is yours and should be based on your needs.

In the end, remember that RAID is a tool, not a magic solution. An informed choice of RAID level, along with regular monitoring and proper backup practices, will make your data infrastructure resilient against most threats.

ServerNet Support

ServerNet engineering & editorial team — specialists in infrastructure, networking and web hosting.

Iran VPS
Share:

Comments 0

No comments yet — be the first!

Leave a comment

Related service

Iran VPS

NVMe in the heart of Tehran — for sites and apps serving Iranian users: the fastest local ping, discounted domestic traffic and instant delivery.