Single-Leader Replication Topology
What You'll Learn
You'll understand how one primary node handles all writes while replicas follow its changes to enable read scaling—the most common replication pattern in distributed databases.
The Core Architecture
In single-leader replication (also called master-slave or primary-secondary), exactly one node accepts write operations. This leader broadcasts changes to one or more follower replicas, which apply them either synchronously or asynchronously (concepts you've already learned).
Think of it like a newsroom: one editor-in-chief (the leader) approves all final stories (writes), then sends them to multiple printing presses (replicas) that distribute copies to readers. Only the editor can authorize new content, but readers can get their news from any press.
How It Works
- Writes go to the leader – All insert, update, delete operations hit a single node
- Leader logs the change – The write is recorded (often as a replication log entry)
- Replicas receive updates – Followers pull or receive the changelog
- Reads can fan out – Clients can read from leader or any replica, distributing query load
The replication can be synchronous (replicas confirm before write completes, guaranteeing consistency but adding latency) or asynchronous (leader responds immediately, risking replication lag).
Why Use This Topology?
- Simplicity – No conflict resolution needed; the leader serializes all writes
- Read scaling – Add replicas to handle more read traffic without impacting write performance
- Consistency options – You can choose sync/async per your needs (learned in lessons 1354-1357)
Tradeoffs
- Write bottleneck – The single leader can become overwhelmed
- Single point of failure – Leader downtime blocks writes (though failover mechanisms help)
Key Takeaway: Single-leader replication uses one primary node for all writes and multiple replicas for read scaling—simple, widely adopted, but the leader can become a bottleneck.