Explore the technology infrastructure of large web sites (three)

Label technology architecturedatabaseInternetFrameworkSun Chenbin
446 people read comments(0) Collection Report

The article said that, the database of separate read and write, read and write separation scheme is the main site of application to read and write the proportion imbalance, and the Internet most of the website are read operation the proportion is far greater than the write operation, this is the website of the mainstream.

If a web site to read and write more balanced, then the site is generally provide professional services website, this site is a tool for users to provide convenient life, similar to the enterprise application software. A lot of attention to the focus of large web site architecture technology should be the kind of Web site for the proportion of reading and writing, because they are more challenging to do.

OK, long winded so much, we should also have a question, why the database for read and write the separation system will increase the overall efficiency of? That the problem of time can draw lessons from hard disk read and write principles, first of all we know hard disk is composed of a circular disc and a magnetic head, then the hard disk in the read data and write data, apparently sequential read and write more than random read and write faster.

Then think about our database, in order to take into account the case of concurrent multiple users to modify a data, because to ensure the accuracy of the data, it is difficult to write more complex, this time we will not change the parallel operation into a serial, and then introduce a lock concept, the data operation by the original execution, when a lock is locked, the implementation of the completion of the subsequent execution of the concept, this concept should be clear, especially in the java thread that part.

So is the concept, the data is very complicated, if this time to join a large number of read operations, so for this DB is very large, so we do read and write separation will improve the efficiency of the system.

In fact, do read and write separation is the first step to optimize the performance of DB, because from the business to speak and read and write separation, basically do not involve any business, from the operational up is also very easy to get started operation is very simple, from the cost is also the lowest, so it is easy to be accepted by any system is a basic way to deal with.

With the increase in the amount of users of our system, we will be more and more large data simple separation has been unable to meet our requirements, this time we have to start thinking of the analysis, which volume is relatively large, relatively bloated table split to form a separate library, such as electric business system data sheet is probably the commodity, order these two tables, it is split into two libraries, which greatly reduces the pressure on the database, this approach is called vertical split DB".

Pay attention to the definition of vertical resolution: the data of different business units in a database is divided into different databases.

Then, when our system is done to read and write separation, data vertical split, our web site is still rapid development, and eventually will reach a new database bottleneck, of course, these bottlenecks appear in the large amount of data, the processing of these tables has exceeded the capacity of a single server, this time we have to further split the single table data, that is, a table distributed to two different databases, this approach is called the level of the resolution of the data.

Note the definition of horizontal resolution: it is based on a certain rule that the data of the same business unit is split into multiple databases.

OK, we draw a picture to sort it out:

Write the picture here.

This way of thinking is very clear, and feel some things only write out, the picture will have a concept... All right, come here first.

Guess you're looking for
View comments
* the above user comments only represent their personal views, does not represent the views or position of the CSDN website
    personal data
    • Visit12638 times
    • Integral:Five hundred and seventy-two
    • Grade
    • Rank:Thousands of miles away
    • Original36
    • Reproduced:34
    • Translation:0
    • Comments:3
    Blog column