Backend & systems·Data modelling and storage engines
you pick the column that decides which database a row lives on, and every query that does not filter on it now hits all of them.
Shard key
Also calledpartition key, distribution key
The field whose value routes a row to a shard. A good one spreads writes evenly and keeps the rows a single request needs together; a bad one creates hot shards or forces scatter-gather on your most common query. It is effectively impossible to change later without a full migration, so it is the decision to spend time on.