How RAID 5 Works
Protecting your earning power
Allmar Technologies, December 23rd 2006
Allmar Technologies is fanatical about uptime. To aide us in ensuring the operational integrity and high availability of your website we have deployed a data storage scheme known as RAID 5. RAID can protect uptime. RAID 5 allows a mechanical hard disk to fail while keeping your website on the array accessible to your visitors. Rather than being required to perform a time consuming restore from tape, DVD, or other slow backup media, RAID 5 allows data to be restored to a replacement disk from the other members of the array, while being simultaneously available to your website visitors. This is of high value to businesses, as downtime quickly leads to lost earning power.
This article is going to discuss how RAID 5 calculates the missing data on the failed hard drive. Since computers work in a base 2 (binary) numbering system, the math is very simple for all of us to follow. This article is by no means all inclusive, however, it demonstrates how powerful this very simple method works.
As always, we welcome your questions, comments, and suggestions. We would be delighted to provide any additional information to you that we can. We hope you find this article informative and educational.
The best way to demonstrate how RAID 5 works is to jump right into an example. Of course it should be understood that in a RAID 5 data storage scheme there are multiple disks. For our simplified examples we are going to assume that we have three disks in our array.
When you store data onto a disk, the computer translates the characters that you typed into a string of 1's and 0's (zeros). Lets say that you saved the word "At", the compter would translate this into "01000001" and "01110100", respectively. In a RAID 5 configuration, it would then save the "A" (01000001) to the first disk, the "t" (01110100) to the second disk, and on the third it would write a parity string of 1's and 0's.
The computer calculates the parity by performing an XOR logical test. If you are not familiar with the XOR, don't worry it is very simple. There are two types of "or"'s, the most common one is "OR". For example, lets say we were playing a guessing game, I am thinking of an object and you are to guess what it is. The object that I am thinking of is a basketball ball, if you were to ask "Is the object that your thinking of orange or round?", I would reply with a "yes". I have not indicated to you if the object is just orange, or just round, or both, I just have confirmed that your question resulted in a positive result. The XOR, unlike OR, requires that one and only one of the conditions be true.
So when the computer calculates the parity of some data, only one of the digits (bits) can be true, in order to result in a true result.
XOR 01110100 (t)
============
00110101 (parity)
Now armed with the parity, the computer can easily figure out the missing data. For example, let's say that the seconds disk (the disk holding the "t") was to fail. The computer simply does an XOR with the known data and it will be able to calculate the missing piece.
XOR 00110101 (parity)
============
01110100 (t)
Thats it, it is that simple! Once again, we welcome your questions, comments, and suggestions.
