What is RAID and how does it work?
The Redundant Array of Independent Disks (RAID) is a term used for describing the technique of improving data availability through the use of arrays of the disks and various data-striping methodologies. The Disk arrays are the groups of disk drives that work together to achieve higher data-transfer and I/O rates than those provided by single large drives.The array is a set of multiple disk drives plus a specialized controller (an array controller) that keeps the track of how data is distributed across the drives. The Data for a particular file is written in segments to the different drives into the array rather than being written to a single drive.
For reliability and speed,it is always better to have more disks. When these disks are arranged in a certain patterns and are use a specific controller, they are known as Redundant Array of Inexpensive Disks (RAID) set. There are various numbers associated with the RAID, but the most common are 1, 5 and 10.
The RAID 1 works by duplicating the same writes on two hard drives. Let us assume that you have two 20 Gigabyte drives. In RAID 1, the data is written at the same time to both the drives. The RAID1 is optimized for fast writes.
The RAID 5 works by writing the parts of data across all the drives in the set (it requires atleast three drives). If a drive failed, then the entire set would be worthless. To combat this problem, one of the drives stores a "parity" bit. Think of a math problem, such as 3 + 7 = 10. You may think of the drives as storing one of the numbers, and the 10 is the parity part. By removing anyone of the numbers, you can get it back by referring to the other two, like : 3 + X = 10. Of course, losing more than one could be evil. The RAID 5 is optimized for reads.
The RAID 10 is a bit of a combination of both the types. It does not store a parity bit, Therefore it is faster, but it duplicates the data on two drives to be safe. You require at least four drives for RAID 10. This type of RAID is probably the best compromise for a database server.