Wikipedia Tuesdays: XOR and RAID 5!
Perhaps I will send interesting Wikipedia links every Tuesday. Perhaps not. Explore and dig in, and find information you did not know before. Read on – it looks technical but it’s actually quite simple and intuitive, and these things are a part of your everyday life, so could be very useful to know down the line.
A RAID drive is a set of multiple drives in an enclosure operating together in a few different ways. Some standard ones: RAID 1, which mirrors both drives, providing extra security. A lost drive can be replaced and automatically be rebuilt. RAID 0, which “stripes” data, putting successive chunks of information in the same place on both drives; this way, drive heads 1 and 2 are reading consecutive bits of data at the same time, so the net speed is about twice as fast.
But here’s where it gets interesting (if you’re still following): To provide the benefits of speed AND backup in case of drive failure, you’d need four drives, right? – one to mirror the first drive and one to mirror the second. Nope, you can do it in three. RAID 5 provides for a third drive which stores the difference between the first two drives using the XOR function. In any location on the drive, if the bits are the same it stores a 0 and if they are different it stores a 1. This way, the RAID array can quickly replace a lost drive.
It used to be that only powerful computers could maintain the overhead necessary for these things, but now RAID controllers take care of the bookkeeping and they are quite mainstream. Filmmakers use them to store HD video, servers use them to store content. Now you can see them in standard consumer hard drives like the one I just got.
There’s so much more ingenuity built into computers than reaches the surface!