jargon

Comparison

Consistent hashingvsShard key

Consistent hashing

you add a cache node and only one Nth of the keys move, instead of every key rehashing to a different server.

Mapping keys and nodes onto a ring so that adding or removing a node relocates only a small fraction of keys. It is what makes distributed caches and shard maps survive topology changes without a total remap. Virtual nodes are the standard addition, because a plain ring distributes unevenly with few nodes.

Full entry →

Shard key

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.

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.

Full entry →

Related comparisons