Shard key choice

user_id hashed → even distribution. Bad choice: timestamp (hotspots on newest). Choose carefully; changing is painful.

Advertisement

Shard key choice

user_id hashed → even distribution. Bad choice: timestamp (hotspots on newest). Choose carefully; changing is painful.

Advertisement

Routing layer

Application code or proxy translates key → shard. Keeps app code simple. Route lookups must be fast (cache the shard map).