Vertical fragmentation
According to the way of business separation, vertical sharding, also known as vertical split, its core idea is dedicated library. Before the split, a database consisted of multiple tables, each corresponding to a different business. After the split, the tables are grouped according to the business and distributed to different databases, thus spreading the pressure to different databases. The following figure shows a scenario for vertically shard user tables and order tables into different databases based on business needs.
Level of fragmentation
Horizontal sharding is also called horizontal splitting. As opposed to vertical sharding, it no longer categorizes data according to business logic. Instead, it divides data into multiple libraries or tables according to certain rules through a certain field (or fields), with each shard containing only a portion of the data. For example, according to primary key sharding, records with even primary keys are put into library 0 (or table), and records with odd primary keys are put into library 1 (or table).
Logical table
Truth table
Data nodes
A bound table refers to a primary table and a sub-table whose sharding rules are consistent. For example, if t_ORDER and T_order_item are sharded according to order IDS, the two tables are bound to each other. Cartesian product association does not appear in multi-table associated query between bound tables, which greatly improves the efficiency of associated query.