Application of RAID in SQL Server (RAID level)

Source: Internet
Author: User

Enterprise-levelDatabaseMost applications are deployed inRaidThe disk array server can improve the disk access performance and implement fault tolerance/disaster tolerance.
RAID (redundant disk array) is simply an array made of cheap hard disks. The objective is to expand storage capacity, improve read/write performance, and achieve data redundancy (backup and disaster tolerance ). It is like a foreigner who used to take n old PCs to form a powerful "server ".Cluster". RAID technology was born in 1987 and proposed by the University of California, Berkeley.
There are several mainstream levels: RAID 0, RAID 1, RAID 5, and raid 10.. Configuration is not very complex. If you are interested or qualified, you can find the relevant information and practice it on your own.

SQL Server 2005 has several commonly used levels:,. Below I will briefly talk about the differences between these levels and their applications.

RAID 0 abbreviationDisk Striping, It canProvides the best read/write PerformanceIf you make the two disks into RAID 0, you can write data to disk A and disk B at the same time.Here, I must note: "You can write operations at the same time ",It does not mean that the same content of the file is "completely written to disk A and disk B at the same time "..For example, if a M file needs to be written to a disk and the write speed of a single disk is 10 Mb/s, it takes 10 seconds to complete the write. However, in a RAID 0 array environment with disks A and B, 10 MB of content can be written to disk A within a single time (in seconds/s, at the same time, the 10 MB content is immediately followed into disk B. In this case, the write speed is 20 Mb/s, which takes 5 seconds to complete, in addition, each disk only needs to store 50 MB of file content, which does not cause hard disk storage pressure. Of course, the Appeal example may be inappropriate, but it only refers to the theoretical environment. There are many other factors in the actual environment, and the efficiency is definitely not enough.
Undoubtedly, this will certainly improve the read/write performance, but it also brings about a problem that if some of the data is lost, all your data will not be retrieved, raid0 does not provide a redundant data recovery policy. Therefore, raid0 can be used in read-only database data tables or replicated databases. If you are not sensitive to data loss, you can also use RAID 0. In short, this level isHigh performance, no redundancy.

Raid 1 Disk ImageIt has no impact on reading.If there are two disks, it only affects writing, because it uses a disk for redundant backup, so if you have two 50 GB disks, the total is 100 GB, however, in Raid 1, you can only use 50 GB. This method affects disk space usage and reduces I/O write performance. In general:When you write a M file to raid 1, the lecture content is written to disk A, and the same content is also written to disk B.. In this way, the content of the two disks is completely consistent (the so-called "redundancy" is not a profound concept ). Originally, only one hard disk needs to be written, but now the efficiency will be reduced if two hard disks are to be written. For the "read" operation, only one hard disk is used for reading in the raid 1 environment, so there is no difference with the normal environment (if both hard disks can work at the same time, ). Only when the data on the first hard disk is corrupted or fails, the second hard disk is started. Of course, if both hard disks are down, they will actually crash. Haha. It is worth mentioning that some books orArticleAs mentioned above, RAID 1 completely copies data to the second disk after writing the first hard disk as an image backup. According to my understanding, is copied and written at the same time.

RAID 5 differs from RAID 1 in that it has more parity. All parity information is distributed across all disks, and the performance is higher than that of RAID 1. However, in the event of disk I/O failure, this will cause a sharp decline in performance. This method is also in the middle of raid0 and raid1, which is a common practice. In a simple language, at least three hard disks (or more) are used to form a RAID 5 array. when data is written to the hard disk, one hard disk is directly written into this hard disk. If RAID5 is used, this data write will be dividedAlgorithmIt is divided into three parts, and then written to the three hard disks. The verification information is also written to the three hard disks, when reading the written data, the data will be read from three hard disks respectively, and then verified through the inspection information. When one of the hard disks is damagedStorageThe data of 3rd disks can be calculated. That is to say, RAID5 storage only allows failure of one hard disk, and must be replaced as soon as possible. When the faulty hard disk is replaced, the data written during the fault will be re-verified. If the fault is not solved and the fault is broken, it will be disastrous.

Raid 10 (also called RAID 0 + 1) is a combination of RAID 0 and RAID 1. It providesHigh performance,High AvailabilitySexBetter performance than RAID5, especially suitable for applications with a large number of writesProgramBut the cost is relatively high. No matter how many disks you store, you will lose half of the disk storage. According to my understanding, at least four hard disks are required to complete the process. Data is split between A and B to store half of the data, and image backup for A and B is performed for C and D respectively. In this way, it is perfect, and it is also my ideal state. RAID 5 parity is not required. Obviously, the cost will be higher. Another pity is the "short board effect" of performance, which does not seem to be so easy to improve unless there are controllers and reasonable control algorithms similar to "Server Load balancer.

of course, this is what we often call " Server Load balancer , high-availability cluster, and horizontal scaling, the purpose of vertical scaling is actually very similar. They are designed to achieve uninterrupted work, ensure data security, and share the pressure.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.