Problem Statement
Which key choice reduces hot-partition risk for sharded writes?
Explanation
Hot spots happen when keys are sequential or skewed. Hashing spreads load evenly across shards.
If locality is needed, combine a coarse bucket with a hash suffix to balance.
Code Solution
SolutionRead Only
shard = hash(user_id) % N
Practice Sets
This question appears in the following practice sets: