Formulating Sharding Rules
If an entity-relationship exists between data tables, formulate the same sharding rule for these tables, and select associated table fields as the sharding key. In this way, associated data in different tables is stored in one shard to avoid cross-shard JOIN.
For example, when creating sharded tables for customer tables, order tables, or order details tables, you are advised to select the customer ID as the sharding key.
Last Article: Selecting a Sharding Key and a Sharding Algorithm
Next Article: Using Global and Unsharded Tables
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.