In leader-follower (primary-replica) replication, where do writes go?
Options
- Any replica can accept writes at any moment
- Only the leader; followers copy it and serve reads (Correct option)
- Only the followers accept writes, then sync
- Writes are sent round robin to all the nodes
Answer
Only the leader; followers replicate and serve reads
Why
One server, the leader (primary), accepts all writes. It sends every change to the followers (replicas), which keep copies and can answer read queries.
Having one writer avoids conflicts. If the leader dies, one follower is promoted to be the new leader (failover).
Remember
Writes → leader. Reads → leader or followers.