May 23, 2021 That's what Linux should learn
Cpu processing performance has been growing at a high rate in recent years, with Intel's latest i9-7980XE processor chip in 2017 reaching 18 core 36 threads. A t the same time, however, the performance improvement of hard disk equipment is not very large, so it has gradually become the bottleneck of the overall performance of modern computers. Moreover, because hard disk devices require continuous, frequent, and extensive IO operations, the risk of corruption increases significantly compared to other devices, resulting in an increased risk of significant data loss.
In 1988, the University of California, Berkeley, first proposed and defined the concept of RAID technology. RAID technology provides a very good data redundancy backup effect by combining multiple hard disk devices into a larger and more secure disk array, cutting the data into multiple segments and storing it separately on different physical hard disk devices, and then using decentralized read and write technology to improve the overall performance of the disk array, while simultaneously synchronizing copies of several important data to different physical hard disk devices.
Everything has its two sides. R AID technology does have very good data redundancy backup capabilities, but it also increases costs accordingly. J ust as we originally had only one phone book, but in order to avoid losing it, we wrote the contact number information into two copies, and naturally we had to buy an more phone book for this purpose, which in turn increased the cost. R AID technology is designed to reduce the cost of purchasing hard disk equipment, but compared with the value of the data itself, modern enterprises are more important than RAID technology with redundant backup mechanisms and the resulting increase in hard disk throughput. In other words, RAID not only reduces the chance of data loss after a hard drive device is damaged, but also improves the read and write speed of hard disk devices, so it can be widely deployed and used in most carriers or medium-sized enterprises.
For cost and technical reasons, it is necessary to balance data reliability and read and write performance against different needs and develop different solutions to meet their respective needs. There are at least a dozen RAID disk array scenarios available, and Mr. Liu will go on to explain in detail the four most common scenarios: RAID 0, RAID 1, RAID 5, and RAID 10.
RAID 0 technology connects multiple physical hard disk devices (at least two pieces) in a hardware or software manner, forming a large group of volumes, and writing data to each physical hard drive in turn. I n this way, in the ideal state, the read and write performance of the hard disk device will be improved several times, but if any one hard drive fails, the entire system's data will be destroyed. I n layman's terms, RAID 0 technology can effectively increase the throughput of hard disk data, but does not have the ability to back up data and fix errors. As shown in Figure 7-1, the data is written to different hard disk devices, i.e. disk1 and disk2 hard disk devices will save data, and finally achieve the effect of improving the reading and writing speed.
Figure 7-1 RAID 0 technical diagram
Although RAID 0 technology improves the read and write speed of a hard disk device, it writes data to each physical hard drive in turn, which means that its data is stored separately, and any failure of any hard drive can damage the data of the entire system. Therefore, RAID 1 technology is required if the production environment does not require the read and write speed of the hard disk device, but rather wants to increase the security of the data.
As can be seen in the RAID 1 diagram shown in Figure 7-2, it binds more than two hard disk devices and, when writing data, writes data to multiple hard disk devices at the same time (which can be considered a mirror or backup of the data). When one of the hard drives fails, the data is automatically restored to normal use by heat exchange immediately.
Figure 7-2 RAID 1 technical diagram
RAID 1 technology is very focused on data security, but because the same data is written in multiple hard disk devices, so the utilization of hard disk equipment can be reduced, theoretically, figure 7-2 shows the real availability of hard disk space is only 50%, the availability of three hard disk devices composed of RAID 1 disk array is only about 33%, and so on. Moreover, due to the need to write data to more than two hard disk devices at the same time, this undoubtedly increases the load on the system computing function to some extent.
So, is there a RAID solution that takes into account both the read and write speed and data security of the hard disk device, as well as the cost? I n fact, data security and cost alone are not likely to significantly improve data security without maintaining the utilization of existing hard drive devices without adding new ones. Mr. Liu Wei also does not need to fool the readers, the following will explain the RAID 5 technology, although in theory to take into account the three (read and write speed, data security, cost), but in fact more like the three "compromise."
As shown in Figure 7-3, RAID5 technology is to save data parity information from hard disk devices to other hard disk devices. T he parity information of the data in the RAID 5 disk array group is not stored separately on a single hard disk device, but on every hard drive device other than itself, with the advantage that no one of the devices is fatally defective if it is damaged; I nstead, an attempt is made to rebuild the corrupted data with parity information when there is a problem with the hard disk device. Technical features such as RAID "compromise" the reading and writing speed, data security, and storage costs of hard disk devices.
Figure 7-3 RAID5 technical diagram
Given that RAID 5 technology is a compromise on read and write speed and data security because of the cost of hard disk equipment, most enterprises are more concerned with the value of the data itself than the price of the hard drive, so RAID 10 technology is used primarily in production environments.
As the name implies, RAID 10 technology is a "combination" of RAID 1 plus RAID 0 technology. A s shown in Figure 7-4, RAID 10 technology needs at least 4 hard disks to be formed, of which two are made into RAID 1 disk array to ensure the security of data, and then two RAID 1 disk array to implement RAID 0 technology, to further improve the speed of hard disk equipment reading and writing. I n theory, this can damage up to 50% of hard drive devices without losing data, as long as the bad ones are not all hard drives in the same group. Because RAID 10 technology inherits RAID 0's high read and write speed and RAID 1's data security, RAID 10 outstripped RAID 5's performance regardless of cost, making it a widely used storage technology.