mysql partition table is not recommended

Origin : When conducting some technical exchanges in the industry, it is more about sub-database and sub-table rather than using partition table.

Solve what problem?

Answer: When the database of mysql single table is too large, the access speed of the database will decrease. The common solution to the problem of "large data volume" is "horizontal segmentation" .

What are the common horizontal segmentation methods in MySQL ?

Answer: sub-database sub-table, partition table

What is the sub-database sub-table of mysql ?

Answer: Divide the data of a large library (table) into several libraries (tables), each library (table) has the same structure, but they may be distributed on different mysql instances or even different physical machines , in order to reduce the amount of data in a single database (table) and improve the access performance.

Sub-database and sub-table are often implemented by the business layer . After sub-database and sub-table, in order to meet some specific business functions, it is often necessary to modify the code .

What is the partition table of mysql ?

Answer: All data is still in one table, but physical storage is placed in different files according to certain rules. This is a function supported by mysql , and the business rd code does not need to be changed .

The partition table looks very handsome. Why do most of the Internet still choose their own sub-database and sub-table to expand horizontally?

answer:

1 ) Partition table, the partition key design is not very flexible, if the partition key is not used, it is easy to have a full table lock

2 ) Once the amount of data concurrency increases, if the association is implemented in the partition table, it will be a disaster

3 ) Separate databases and tables by yourself, control business scenarios and access modes by yourself, and control them. Partition table, I wrote a sql in research and development, I am not sure how mysql works , it is not very controllable

4 ) The pit of operation and maintenance , hehe

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325783207&siteId=291194637