A table,
Vertical split: Split by functional modules to resolve contention between tables
Horizontal split: Split the data of a single table into different databases to solve the pressure of increasing data volume in a single table
Horizontal segmentation features:
1) The structure of each library (table) is the same
2) Each library (table) data is different, there is no intersection
3) The union of all libraries (tables) is full data
Vertical split features:
1) Each library (table) has a different structure
2) Each library (table) has at least one intersection column of attributes
3) The union of all libraries (tables) is full data
Vertical split, common scenarios:
1. Split large fields vertically. Create large fields in a separate table to improve the access performance of the underlying table. In principle, avoid large fields in the database in performance-critical applications.
2. Use vertical split. Split by service module.
3. Split access frequency vertically. Basic, frequently used properties can be separated vertically from less frequently used properties
Horizontal split, common scenarios:
1. Split horizontally by time
2. Split users horizontally by user ID attribute
3. Horizontally split services
Two, table, partition
Partitioning partitioning partitioning partitioning partitioning partitioning partitioning partitioning partitioning partitioning partitioning partitioning partitioning partitioning partitioning partitioning partitioning partitioning partitioning partitioning partitioning partitioning partitioning partitioning partitioning partitioning partitioning partitioning partitioning partitioning partitioning partitioning partitioning partitioning partitioning partitioning partitioning partitioning partitioning partitioning partitioning partitioning partitioning partitioning partitioning partitioning partitioning partitioning partitioning partitioning partitioning partitioning partitioning partitioning partitioning partitioning partitioning partitioning partitioning partitioning partitioning partitioning
After table splitting, the concurrent capability of a single table is improved, and the DISK I/O performance is also improved. Partitions break the disk I/O bottleneck to improve disk read and write capacity and increase mysql performance.
Partition application scenarios:
1. The query speed of a table slows down
2. The data in the table is segmented
3. Operations on data often involve only some data, not all data
Sub-table applicable scenarios:
1. The query speed of a table is too slow to be used
2. The speed slows down when frequent inserts or joint queries are performed
Three, separate database, separate table
Split table can solve the problem that the query efficiency decreases due to the large amount of data in a single table, but it cannot improve the concurrent ability of the database. In this way, the concurrent read and write ability of database can be improved.
Similar to the split table strategy, the split database can also be modelled on keywords to route data access.
4. Problems existing in separate database and separate table
1. Transaction management difficulties
2. Cross-library cross-table join problem
3. Additional data management burden and data operation pressure