Reprinted from http://blog.csdn.net/kobejayandy/article/details/8775138
Data segmentation can be physical, the data through a series of segmentation rules to distribute the data to different DB servers, routing rules to access a specific database, so that each access to face is not a single server, but the n server, which can reduce the load pressure on a single machine.
number It can also be in a database. , the data through a series of segmentation rules, the data distributed to a database of different tables, such as the article into a article_001,article_002 and other sub-table, a number of sub-table horizontal flattening has formed a complete logic of the article table, The purpose of this is actually very simple. For example, for example, the article table now has 5000w data, at this point we need to add (insert) a new data in this table, after the insert is completed, the database will be re-indexed to this table, 5000w rows of data indexing system overhead is not negligible. But conversely, if we divide the table into 100 tables, from article_001 to article_100,5000w, there is only 500,000 rows of data in each sub-table, At this time, we are going to a table with only 50w rows of data after the Insert data index will be a magnitude decline, greatly improving the efficiency of the DB runtime, increase the concurrency of the DB. Of course, the benefits of the table are unknown, and there are many obvious benefits to be found, such as the lock operation of the write operation.
In conclusion, the sub-Library reduces the load of the single point machine, and the table increases the efficiency of the data operation, especially the write operation.
[Reprint] Vertical Segmentation and horizontal segmentation of databases