1. Replication
Leader-follower replication copies writes from a leader to follower replicas.
replication: leader-followerTyporithm · hard
Step 1 of 8 · intro card
Data Layer
Replication (leader-follower) copies data to followers, scaling reads and adding availability. Sharding partitions data by a key to scale writes; the shard key must spread load to avoid hotspots, and consistent hashing minimizes data movement when rebalancing nodes.
Replication keeps copies of the same data on multiple machines. In leader-follower replication, the leader takes writes and streams them to followers; reads can hit any follower, which scales read throughput and keeps the system available if the leader fails.
Sharding splits the data itself by a key so each node owns only a slice. Because writes are spread across shards, this is how you scale write throughput beyond one machine.
The shard key is the critical decision: it must distribute load evenly, or one shard becomes a hotspot while others sit idle. When you add or remove nodes, consistent hashing minimizes how much data has to move, avoiding a full reshuffle.
Replication (leader-follower) scales reads and adds availability.
Sharding partitions by key to scale writes.
Consistent hashing limits data movement on rebalance.
scaling_data:
replication: leader-follower
read_scaling: replicas
sharding: partition-by-key
shard_key: avoid-hotspots
rebalance: consistent-hashingConnect each part of the code to the concept before you type.
Leader-follower replication copies writes from a leader to follower replicas.
replication: leader-followerFollower replicas serve reads, spreading read load and adding availability.
read_scaling: replicasSharding partitions data by a key so writes scale across many nodes.
sharding: partition-by-keyA good shard key spreads load evenly so no single node becomes a hotspot.
shard_key: avoid-hotspotsConsistent hashing moves the least data when nodes are added or removed.
rebalance: consistent-hashingRead the concept map and follow the code breakdown.
Type the implementation, repair mistakes and work through every recall exercise.
Use the final check without hints; revisit weak concepts in short practice sessions.