When dealing with large data volumes, it consumes a large amount of database performance, so when designing database tables, consider this phenomenon, the reasonable database design, to improve database performance to reduce database pressure.
When the table records too much, such as products, orders, a large number of customers, etc., is the main source of database access pressure, at this time, from the database split table angle to reduce pressure, you can use the following two ways:
1. Split the table horizontally
Horizontal split: Divides the table's record horizontally into two tables, using a value of the table's primary key PK as the boundary
2, Vertical division of the table
Vertical split: Too many table fields, split by table field, and a single sheet is decomposed vertically into two tables
Example: There is a product table, the data volume is 10w, the data quantity is stable;
Order table, data volume is 200w, data volume has a growth trend;
User table, data volume is 100w, data volume has a growth trend
Scenario One: Vertical segmentation solves the IO competition between table and table, and does not solve the pressure of increasing the number of single-table species.
Further solutions:
--Placing product tables and user tables on one server;
--The order form is placed on a single server
Scenario Two: Horizontal segmentation, to solve the single-table data volume of pressure, did not solve the table and table IO competition
Further solutions:
--user tables are split into male and female users by gender
--order form split into completed orders and unfinished orders
--Product tables, unfinished orders placed on one server
--Completed orders and male users placed on a server
--Female users on a server (female users love Shopping)
This article is from the "Liz" blog, make sure to keep this source http://3484323.blog.51cto.com/3474323/1738827
Big Data scale structure design case