Replication, Sharding & Consistent Hashing · Key takeaways
1 min readRapid overview
Key takeaways
- Replication scales reads and provides failover; only sharding scales writes.
- Async replication means read-your-own-writes anomalies. Route post-write reads to the primary or track the log position.
- The shard key is effectively permanent. Derive it from access patterns and atomicity needs, not from even distribution alone.
hash % Nremaps almost everything whenNchanges; consistent hashing limits it to1/N.- Virtual nodes are what make consistent hashing distribute evenly and allow weighting.
- Even row counts do not imply even load. Measure operations per shard.
- Prefer choosing a key that avoids cross-shard transactions over implementing them.