Data skew is an uneven distribution of data or workload across horizontal partitions. Some nodes may be underused while others are overused, limiting the benefit of distributing a database across nodes. section 5.2.1
A partitioning key with only a few distinct values can leave some partitions much larger than others. Cardinality—the number of unique values in a column—therefore matters when choosing the key. User IDs are an example of a high-cardinality key. section 5.2.1
Check data size and access patterns separately:
- For uneven data distribution, choose a high-cardinality key; if skewed writes enlarge a few partitions, rebalance them. section 5.2.1
- For hot partitions, partition further within them or give them more resources. section 5.2.1
