Skip to content
Features

The skinny on RAID

Introduction The original article on RAID, entitled "The Quick Skinny on Raid" appeared on Ars back in October of 1998.  We recently decided that we should beef this section up. Why?  For one, after Panders’ review of the Promise FastTrak66 IDE RAID controller, we quickly came to realize that there’s a serious hunger out there … Continued

Ken Fisher – | 0
Story text

Introduction

The original article on RAID, entitled "The Quick Skinny on Raid" appeared on Ars back in October of 1998.  We recently decided that we should beef this section up. Why?  For one, after Panders’ review of the Promise FastTrak66 IDE RAID controller, we quickly came to realize that there’s a serious hunger out there for information on RAID, but simultaneously, there’ a serious lack of reliable and easy to understand info ready to be consumed.  So, without further ado, we remove the word ‘quick’ from the title, and present to you an almost completely reworked article, with new graphics, detailed ECC explanations, and a fresh new scent. The basics behind RAID

For all you Quiz Bowl participants, let’s get the fun acronymical knowledge out on the table first: RAID stands for Redundant Array of Inexpensive Disks.

Seriously.  No, wait, I’m not joking. That’s really what it means.  (You wouldn’t believe how many people e-mail in saying that it’s some combination of random, really, real-time, redundant, array, assembly, interconnected, independent, inter-relation, devices, etc).

Despite what Techweb and other sites say, the original name as proposed by the original researchers is just that (just consult Patterson, Gibson and Katz). There’s a darn good explanation for the name, and for the genesis of RAID per se.  Since the inception of the hard drive, disk I/O performance has been a persistent performance bottleneck.  Here’s the abstract from the above mentioned source (Patterson, et al):

Increasing performance of CPUs and memories will be squandered if not matched by a similar performance increase in I/O. While the capacity of Single Large Expensive Disks (SLED) has grown rapidly, the performance improvement of SLED has been modest. Redundant Arrays of Inexpensive Disks (RAID), based on the magnetic disk technology developed for personal computers, offers an attractive alternative to SLED, promising improvements of an order of magnitude in performance, reliability, power consumption, and scalability. This paper introduces five levels of RAIDs, giving their relative cost/performance, and compares RAID to an IBM 3380 and a Fujitsu Super Eagle.

Additionally, statistics indicate that the hard drives of yesterday were not quite as reliable as drives that are manufactured today (I’m not sure if that says a lot or not). So, if RAID was born forth from the desire for more speed and more data security over 12 years ago, it hasn’t really taken the world by storm until recently, due to the fact that the third letter in RA*I*D is finally becoming true: disks really are inexpensive.  As a result, interest in utilizing RAID in different scenarios, even on workstations, has risen greatly. Heck, right now, you can by a server-class machine from Dell, with RAID, for under $3,000.  Absolutely unthinkable just 3 years ago!

There are varying types of configurations for RAID, and each is assigned a different notation based on the cleverly conceived "RAID X" scheme (you know it sounds cool, even if it’s not the most useful designation scheme).  Now, I gotta let you know – I’m going to be thorough.  Some of the the implementations I’m going to mention exist solely on chalkboards, having been neglected by vendors, systems developers, and even the media. Some are out there floating around in obscurity, and others are the buzzwords that legends are made of (at least in the world of storage technology). First up we’ll talk about the two forms of RAID you’re most likely to see on a workstation near you: RAID 0 and 1. 

 

RAID 0, the Striped Set

Ah, good ole’ RAID 0. Also known as the Striped Set without parity, RAID 0 is a kind of RAID half-breed.  It features one of the most prominent processes known to RAID devices–striping (as in, you have stripes on your shirt).  Striping comes in myriad forms and flavors (as you’ll see), but it can be understood loosely as this:

Using an array of disks, that is, several hard drives connected to a controller of some sort, one facilitates the rapid reading and writing of data by separating data into consecutive blocks that are each read or written to different physical drives (or spindles), in order.

Imagine writing the first 7 letters of the alphabet with 3 writing hands instead of one.  If your brain was able to pre-sort the data so that hand one started on ‘d’ the second it finished ‘a’, and so on, you would theoretically have a write-rate three times faster than with one hand.  

As a result, system I/O performance improves greatly because the data is spread out over X spindles, on possibly more than one channel. Better performance will be observed as the physical disk-to-controller ratio approaches one.  But then again, so will the cost. One SCSI RAID controller can support several disks efficiently, and as my Promise RAID controller review showed, IDE RAID 0 isn’t too bad either.

It is important to note that this config is not truly a valid RAID implementation because it’s not fault-tolerant (and thus does not have the complementary overhead work). This is really important to understand.  If one drive fails in a RAID 0 array, all data on the array is completely lost!  In that respect, RAID 0 can be dangerous.  If you have a RAID 0 implementation with 3 10GB drives, you’ve got three different points of failure that could trash 30 GB of data.

This doesn’t stop most crazy performance freaks, of course (like me).  RAID 0 is a good entry-level to small environment alternative to dumping huge monies on fancier tech, especially in instances where I/O performance is more important than file redundancy.  You all do backups anyway, right?

The thing to note with RAID 0 is its postulation: striping data across disks is a performance boosting configuration.  We’ll see RAID 0 re-interpreted in a number of ways in the next few pages.  But before that, we have to meet RAID 0’s antithesis, RAID 1.

RAID 1, Disk Mirroring

Up next is the most simple RAID config of them all, RAID 1, aka Disk Mirroring.  The title tells all: you have two or more disks, and you mirror the contents of one onto the other.  With 100% data redundancy, little to no restoration of data on a single disk failure is necessary … simply copy the pertinent files back from its mirrored twin to the replacement spindle. Or, when you’re running an OS or special RAID controller that is mirror aware, simply "break" the mirror and you’re set–no more downtime than it takes to reboot or reconfig your controller while another hard drive makes its way to you.

You can already see that there’s no speed benefit here on account of the absence of striping.  Rather, due to Error Checking/Correction (ECC), write performance can often be slower than what you’d get with just one simple hard drive not being mirrored at all.  Much of this inefficiency is related to the fact that the mirroring work is often placed on the CPU(s).  Whether it be in software, or cheap RAID hardware, if your mirroring isn’t handled by the controller, you may actually loose performance. NT/2000 users should be wary on account of the ease with which one can implement RAID 1 in software–it’ll slow ya down, for sure.

Now here’s an oddity: a read transaction can theoretically occur twice as fast as on single disk. Hence RAID 1 is often used on low-end web servers. The read performance is standard, if not better than single disk performance, and the poorer write performance is largely irrelevant on most web servers (save those doing transactions, of course). RAID 1 configs are great for mid-volume FTP servers as well.

In a nutshell, folks turn to RAID 1 when data integrity is at much more of a premium than I/O performance.  RAID 1 is relatively cheap and quite easy to utilize, and for the cost of a decent backup tape solution, another disk for RAID 1 might be right up your alley.

I should note that this discussion is based on the more recent, er, modern definition of RAID 1.  The original model for this config actually included striping (as in RAID 0), and not simply "disk duplexing." In the end, however, the duplexing model is what the industry uses, and RAID 1 is synonymous with that. Therefore, notice that RAID 1’s contribution to the world of storage technology is the principle of data mirroring. With striping and mirroring covered, there’s actually only one more basic technological concept to cover: parity.

RAID 2 and 3—Enter Hamming and
XOR ECC

RAID 2 may be lesser known, but it’s the first RAID type we’ll see here that introduces the all important technology known as parity.

With RAID level 2, data correction actually occurs on the fly via an implementation of Error Correcting Code, or ECC for short. If one disk were to die in a RAID 2 configuration, there would be no interruption in service. Using parity, a single missing disk is "reconstructed" on the fly. Cool, eh? RAID 2 uses a very specific kind of ECC called Hamming Code. The raw specifics of Hamming Code are beyond this discussion, but that won’t stop us from bastardizing it, and offering a more pedestrian explanation anyway.  It’s important to try, because we’ll see why Hamming Code lost out to XOR ECC in the race to the most popular RAID Parity configurations.

Detour I: Parity BBQ

Our graphical examples are, of course, a bit misleading since data is stored in binary format, not in letters.  Bits, the basic units of binary data, encode everything from text to graphics to databases on the level of the disk I/O subsystem. One misread or corrupted (or unavailable) bit can spoil your data. What engineers wanted to do was find a way to detect and correct errors in a reasonably uninterruptive manner.  The former is easy, but the latter is quite difficult.

Detecting errors in certain kinds of data transmission can be a simple as requesting information twice (perhaps from two different sources), and comparing the two transmissions.  But correcting problems once they’re identified is tough. Say we had a RAID 1 config, with not one but two mirrors. If the three volumes returned a chunk of data with value [1001001], everything looks OK, right?  But what if disk 0 reports [1001001], and disks 1 and 2 report [1101001]? Have we detected an error?  Yep.  Do we know for certain which chunk is correct?  Nope. We could vote 2 against 1, but that’s hardly reliable. (Now please note that this above example has nothing to do with how ECC works in RAID, we’re still getting there).

Parity

Enter in Parity. Stepping a bit back from the above example, let’s forget about hard disks for the moment and focus on the 7-bit ‘word’ 1001001. The idea behind parity is that a little more information attached to a word can say a lot about that word’s value. Let’s delve into a little example. A popular form of bit parity is Even Parity. The 7-bit 1001001 word could have an eighth parity bit added to it to make the sum of the word even (called an 8,7 word). In our above example, 1+0+0+1+0+0+1=3. Not even.  So, the 8th bit would be ‘1’.  If the word turned out to be even, we’d pop a ‘0’ on there. Why would we do this? Well, if one of the 7 bits gets flipped, we’ll know. 11010011 is an invalid ‘word’, so we’d know sumptin’ was up (we’d expect 11010010). This system can be quite fast, and quite useful.  After all, there are only 256 possible ‘words’ in this system, with only 128 being valid (namely, the even words). Now I know you’re saying, "But Willis, if two bits get flipped, or four, then you won’t detect an error!" Touch?, mon frere!

Enter Hamming, which has nothing to do with Porky Pig. You were astute to notice that in the above examples, only two flipped bits were required for a word to appear valid, even though it was corrupt. This limit is what’s called the Hamming Distance, and you guessed it: the greater the hamming distance, the more reliable the ECC scheme–the more flipped bits that it would take to reproduce another valid word is what protects the integrity of the scheme. 

Fixing bad data in a ‘word’ is a bit frustrating, because all the work is done in just identifying the corrupt bit.  To actually fix a corrupt bit, you have only to flip its value: such are the niceties of binary.  But determining just which bit is in needin’ of a flippin’ is hard.  Take 10010010. It’s invalid because it’s not even.  To make it even, we could of course flip any single bit, and be set.  But that’s not good, because that doesn’t tell us how to get back to the original state of the word. So what do we do? If the distance between valid codewords can be stretched out to 3 (from 2), error correction becomes possible.

Sticking with 7 bit words, we could implement Hamming Code and use 3 of the available bits for ECC.  Let’s look at 1110110. The red bits are parity control. Any change to any of the 4 white numbers would be detectable and correctable, because the parity bits check and recheck themselves down the line, as it were. As you can see in the picture below, the first three bits are odd parity, so the first parity bit is a 0. The first five bits (four info bits plus the first parity bit) have an even parity, so the second parity bit has value of 1. The first six bits (four info bits plus the first two parity bits) have an odd parity, so the final parity bit is 0.

This is the ECC scheme implemented in RAID 2, but when we turn to storage, we’re not so much worried about flipped bits as we are about dead disks!

When put to practice, the ECC scheme works in conjunction with a striping mechanism to provide multi-disk fault tolerance.  And man do I mean multi-disk. RAID 2 configurations typically have 1 disk per bit. Wowsa! A 64-bit word would require 64 data disks.  Then comes parity.  A 64-bit data word needs an addition 8 bits for parity, bringing us to a total of 72 whopping disks. See why this is hardcore? The problem with Hamming Code (well, one of them) was that as the word size grew, the parity bits did too. Therefore, this ECC scheme quickly became inefficient in terms of cost and support.


 

Keeping in mind that we’re using letters in the graphics instead of bits just to keep your eyes from glazing over, consider ECC1(a) as the parity bit for a + r, and ECC2(a) as the final parity bit for a + r + s + ECC1(a). In this scheme, any of the three data bits could change, and the parity bits would provide the data needed for on the fly translation. Take a shotgun to disk 2, and all the data would still be available. Sounds cool, eh? Of course, if you take a gun to two of the disks, then you’re screwed. You’ll fall back under the proper hamming distance, and data will no longer be reasonably reconstructable.

RAID 2’s thirst for disks kept it out of the running as a popular technology for anything but mainframes. For small data words, RAID 2 doesn’t deliver very good performance. Although in the example above we have 5 spindles working, combined latency can make transacting anything but large files a waste of power.

Hence, RAID 2 didn’t deliver the goods to the small guy, the dude who didn’t happen to have an Amdahl surrounded by Halon vents in his office. Hence, the birth of RAID 3.

RAID 3: the birth of the common man’s ECC

Raid 3 is both similar and similarly dissimilar to RAID 2. Like level 2, RAID 3 is not supported under NT. In addition, level 3 also reserves the dedicated parity-disk model for active recovery. But RAID 3 bests RAID 2 by moving up to byte-level data striping (8 bits in a byte), and switching to a more effective ECC scheme. Those of you versed in mathematics and logic may recognize XOR, or "eXclusive OR." Actually, we could have covered this term already. XOR is just another algorithm for treating data, but it’s far more simple than Hamming Code. As a basic Boolean logic operator, the end result of a XOR operation should result in a true or false verdict, or in this case, an even/odd verdict. Unlike previously when we were talking of even parity, XOR is oriented towards odd parity. When fed data ‘A’ and ‘B’, XOR asks if it’s true that either one or the other (BUT NOT BOTH) of these values are "true", i.e., odd. 0 + 0 = False (0; none are odd). With me so far? Let’s hop to a table:

XOR Example
A XOR B Result
0 0 0
1 0 1
0 1 1
1 1 0

1,1 is false because both bits are odd. In multibit situations, you’d XOR a series of bytes together to produce a result. Consider the above table, and pretend that the A and B columns are "bytes" (a byte is really 8 bits, though). So byte A is 0101 and byte B is 0011. XORing these two bytes together gives you a result byte of 0110. Now, the cool thing about XOR is that if you were to lose either byte A or byte B, as long as you have one of the original bytes and the result byte, you can reproduce the lost byte by XORing the result byte with whichever byte you’ve got left. So XORing A with Result gives us B, and XORing B with Result gives us A. Look at the above table and try it out, and you’ll see that it works.

You can expand this to include multiple bytes in multiple columns, and the end result is that XOR makes for lightweight ECC, since XORing any n-2 number of bytes with the result byte will allow you to reconstruct byte n. For fault tolerance, this means that one "chunk" of data can go bye-bye, and yet be recovered (so long as the XOR parity information was stored on the write). Because of this, multiple parity disks aren’t needed (yeah!).  Hence, RAID 3:

As mentioned earlier, this RAID type stripes data at the byte level, with chunk sizes typically ranging from 32 to 512 bytes in size. This larger data size allows for higher performance, but it should be noted that on heavy I/O servers, the parity drive becomes a huge bottleneck.  Since it is always written to, even if only a tiny amount of data is stored, parity writes can queue up pretty quickly. 

RAID 4 is the mutant half brother of RAID 3, and need not be treated extensively. Whereas data is stored in byte-chunks in RAID 3, RAID 4 ups the ante and stores data in entire files per drive.  If you save your MP3s to such an array, the files will not be split up over several drives.  Rather, they will each be wholly (individually) written to a single disk. Interestingly, the XOR parity method can still be performed on the data, but instead of generating parity on striped files (as above), it essentially generates sector-based results, across multiple files.  

So, why RAID 4? The ‘entire-file’ method allows for extremely high read data transaction rates in high I/0 applications, because multiple files can be read at once. Conversely, writing actions are quite slow. Here’s why: considering the nature of the parity process, a change to a single file requires the other disks to be read in order to calculate the new parity. Efficiency-wise, this is a downgrade, since other striping forms of RAID have the benefit of writing data across multiple drives anyway. When you throw in a whodini-like trick requirement to configure/design a controller to support this level, you’ll find that RAID 4 is not the solution for you.  Better configurations exist for high data read rates, and with exponentially better data security and recovery options (this is my clever tie into the next config).

RAID 5: The Kleenex of RAID

RAID 5 performance is all about the controller.  Level 5, depending on implementation and the controller in use, can offer (1) a data read transaction rate as formidable as any RAID level (even RAID 0 when one talks about the real word as opposed to theory), (2) a somewhat equally impressive write transaction rate, and (3) an impressive aggregate transfer rate.  What it offers that RAID 0 doesn’t is security. By ideal design, only one "virtual" parity disk is assigned to each array (but more can be added while typically reducing transaction rate efficiency).  Each entire data block is written on a data disk; parity for blocks in the same rank is generated on Writes, recorded in a distributed location and checked on Reads (though not always).

Now, you might wonder how RAID 5 can perform on par with RAID 0 on a read operation.  Theoretically it cannot. But on closer evaluation, we’ll see why it’s so powerful. Put simply, this config fully incorporates both data striping & parity, and is thus a popular alternative for server solutions (especially in the WinNT world). Notice the "virtual" up there.  If RAID 3 was tasty, RAID 5 is tastier because now parity information is written out all over the array, and not just on a single disk.  This is great because it greatly reduces the kind of bottleneck that you’d experience with a single-parity-disk solution. Let’s take a look at the graphic.

As you could probably guess from the graphic above, multiple writes and reads can occur simultaneously, without stepping on each other’s toes. As the number of disks go up, so do the potential number of reads/writes that can occur simultaneously. In the real world you’ll find that RAID 5 configurations on a quality RAID controller can actually be as fast as RAID 0 implementations because of their predictability and their read cache performance.  Your write performance, too, is dependent on your controller’s cache, which is commonly between 64-256MB these days.  As opposed to RAID 0, RAID 5 simply needs a large cache to write at an acceptable rate.  Some controllers are optimized for this kind of performance, and actually perform better in a RAID 5 configuration than in a RAID 0 config – I’ve seen it.  This all, of course, hinges on your controller’s quality and intended purpose, and is not truly a ramification of theory per se.  Theoretically speaking, RAID 5 isn’t all that, but when you buy your next ProLiant from Compaq, get a dual RAID controller with 64+ MB of cache, and run the tests.  You’ll see why businesses all over are opting for RAID 5.

In addition, with the onset of "hot-swappable" disks, one can easily swap good & bad spindles in this config with minimal jeopardy to data, while the system is running, and the RAID controller reconstructs the missing data via the parity information stored on the other disk(s).

RAID 6 is merely a mutation of RAID level 5. The difference? RAID 6 uses an independent, secondary parity distribution scheme for additional fault tolerance.  Like in RAID 5, data is striped at a block level across the disk sets while parity information is generated and written across the array. Some engineers who were really worried about fault tolerance decided that the 1 in 21,000 year total failure rate was too much to handle, so they added a second parity set to the mix. Now it’s possible for more than one drive to fail simultaneously, and have the ship still stay afloat. Bear in mind however, both system and controller overhead is much greater as parity addressing calculations soar. Also, as opposed to just one disk in level 5 you lose two disks per array (commonly noted as N+2).  Although not specifically an NT alternative, if application serving is "A-1 Mission Critical" in your world, this might just be the perfect solution for you (although rumor has it that no commercial implementation of this currently exists). You certainly wouldn’t want this for anything but read operation functions.

RAID 7

If this were Jeopardy!, we’d be in the $1000 range with this type of RAID. RAID 7 is only offered as a package deal, which is to say it is a proprietary solution.  That’s right, no piecing together of a system as you wish… everything is already designed and configured. And it is for this reason that some people even refuse to call RAID 7 real RAID.  

With level 7, you basically have an implementation of RAID 4 with an added special seasoning: all I/O transfers are asynchronous, independently controlled and cached including all host interface transfers.  Furthermore, all disk reads and writes are centrally cached via a high speed system bus called "x-bus."  The disk dedicated for parity (a la RAID 3-style) can be on any of the channels. The real-time OS responsible for coordinating this asynchronous action is actually resident on an embedded array control processor (the controlled communications channel is also regulated by this embedded OS).  Expandability and scalability are not a worry with RAID 7, as one can utilize up to 12 host interfaces and up to 48 drives.  In addition, the SNMP agent included allows for easy remote monitoring and system management.  Now, I know what you are saying … enough with the specs, well here are some stats:  this config allegedly can offer anywhere from 150-600% better write I/O performance than any other RAID level, but those findings have been seriously disputed. On that dark side, I only know of one vendor that offers this solution and it’s extremely pricey.  On top of that, they have an extremely limited warrantee and do not allow user maintenance.  

Looks really cool, but not very practical by any means.  Now, stay turned for RAID 10 & 53: two forms of RAID you may actually see in real life. 

RAID 10 & 53: Voltron RAID

Another moderately expensive RAID config is RAID 10.  This level is implemented as a striped array whose segments are mirrored as RAID 1 arrays. RAID 1+0, get it? Level 10 shares the same fault tolerance as RAID 1 (the basic mirror), but compliments said fault tolerance with a striping mechanism that can yield very high read rates. Functionally, the array can perform read transactions on par with the lightning fast RAID 1 array, but the added fault tolerance comes at the price of additional data mirroring. You can see then that this solution is not easily scalable. Still, it could be a viable solution for a scenario in which RAID 1 is desirable, but additional performance is needed as well. Let’s have a look:


 

Woo! Spooky ghost drives! RAID 10 is the first so-called "two dimensional" array, coined as such on account of the fact that two different arrays are made to work together. I’m hoping the graphics convey this, but the foremost array of drives stripes data in a series, and the background (ghosted) drives mirror the foreground drives.

Just when naming made sense, RAID 53

Ah, RAID 53.  If logic were the basis of all decisions, this type would actually be named RAID 03 (or 30), since it’s basically a striped (RAID 0) array whose segments are RAID 3 arrays.  Now, this one proved a little too tough for rendering with our lame graphics skills, so let’s pull the RAID 0 and RAID 3 image out of your cache, and talk about how this works.  First, we have the main storage structure, RAID 0:

We have three "disks," no parity, and no mirroring.  If you recall, this is the theoretically fastest config possible. But, you might also recall that in the event of a failure, there’s no recovery possible (well, aside from backups). The idea behind RAID 53 is that you could keep that lightning fast RAID 0 transfer rate if you could just somehow make each disk more fault tolerant.  Here’s where things get crazy. Imagine that each disk is now virtually represented by a RAID 3 config. (Although the example below has five disks, you only need three to make this work.) Each "disk" or "segment" of the RAID 0 config is actually comprised of RAID 3 arrays, and gains fault tolerance via that method.  Here’s another look at RAID 3:


 

This RAID config shares the same fault tolerance as level 3, as well as the same overhead for fault tolerance.  Additional kudos contributed by the RAID 3 portion of the hybrid include high data transfer and system I/O rates.  On the other side of the pillow, the donated striping aspect allows for high I/O rates for small requests.  Choice in drive selection is very limited, as all the spindles must remain synchronized.  Like RAID 10, this is a very expensive solution to implement and should only be considered if you would have otherwise gone with RAID 3 but need some additional performance boost.

Conclusion

As for RAID 69, a picture that was legally presentable was unfortunately not available.  However, let me just state the basic data structure: A is complementary to b, and B is complementary to a…. err, OK ;) 

Hopefully after reading this you feel like you can hold your own in one of those everyday RAID arguments by the good-ole’ water cooler. Keep in mind there are other RAID types out there in the wild … however, as you should have grasped from the info above, all RAID types are inevitably based on the core concepts of data striping, mirroring, and parity. 

Epilogue: An assortment of benchmark tools

Rather than do a review of all the various tools out there, I’ll just throw out some links that can get you further down the path to RAID nirvana.  For Windows NT we have the IOmeter, NBench, and NTiogen utils, mostly for benchmarking but some also contain very useful data.  For Win 9x and DOS we have Michael’s Disk Benchmark (actually, this is the only Win 9x tool I’ve seen, the rest are all DOS based), COREtest, Qbench, and RAIDmark.  Oyeah, and for the well-endowed Unix world we have Bonnie, Disktest, IOBENCH, IOCALL, IOstone v. C/II, and IOzone v.2.01.  Anyone with links to some good NetWare utils should drop me a line, and I’ll link ’em up.  Special thanks to Intel and AC&NC for these utils!

Photo of Ken Fisher
Ken Fisher Editor in Chief
Ken is the founder & Editor-in-Chief of Ars Technica. A veteran of the IT industry and a scholar of antiquity, Ken studies the emergence of intellectual property regimes and their effects on culture and innovation.
0 Comments

Comments are closed.