Sharding

Consistent Hashing

A classic approach is to maintain a modular space of hashed keys, and use the regions between shards to assign keys. This is known as consistent hashing. It works, but has some drawbacks:

Indirection Tables

A cooler approach in my opinion. Just put a table of hash(key) -> server address on every client, and assign fewer table entries to buckets with more keys. This way, the load is more evenly distributed. You can then broadcast any changes to the table to every client server.