In this chapter
We'll meet replication factor and the two real topologies replicated copies can use — leader/follower (one real authority, simple to reason about) and leaderless (any replica can accept a write, quorum keeps things honest) — and see GreenMart's own incident as neither topology's discipline actually being followed.
The Problem in Real Life
Sarah wants to actually design GreenMart's real answer now, not just understand the trade-off in the abstract. The first real decision: when GreenMart keeps three copies of the stock count, who's actually in charge of writes? Does one region get to say "this is the real number," or does authority genuinely spread across all three equally?
This isn't a small implementation detail. It's the real, structural decision every remaining mechanism in this Act builds on top of.
One region in charge, or all three equal? Those sound like very different systems.
Mike
One Region in Charge vs. Every Region an Equal
Replication factor is the real copy count
The same real number as Act 5's RF 3 — how many total copies exist, regardless of which topology organizes them.
Leader/follower: one real authority
One leader accepts every write and propagates it — simple, with one clear place a write has to go through.
Leaderless: any replica, quorum keeps it honest
No single leader to fail — any replica accepts writes directly, with quorum (next chapter) as the real safeguard.
GreenMart followed neither discipline
Each region acted with local, leader-like authority without ever being a genuine leader or enforcing real quorum.
Replication Topologies
Replication — keeping more than one real copy of the data — is the starting point every distributed system shares, for the two real reasons already named: surviving a failure, and serving reads close to wherever a customer actually is. How those copies actually coordinate writes is the real, structural decision this chapter is about, and there are two genuinely different real answers.
- Leader/follower (also called primary/secondary) systems designate one copy as the leader, which accepts all writes and passes them along to the others. Genuinely simple to reason about — there's exactly one real place any given write has to go through, and exactly one place that can say "this is the current, authoritative value" at any given moment.
- Leaderless systems have no single designated leader at all — any replica can accept a write directly, and the system relies on quorum (real, checkable agreement among enough replicas, covered fully next chapter) rather than a single leader's own authority to keep things straight. Genuinely more available in one specific, important sense: there's no single leader whose own failure blocks every future write until a new one is chosen.
Leader/Follower vs. Leaderless — Where a Write Actually Goes
A write request arrives
e.g. update stock count for the gift box
Must go through the one leader
Leader accepts it, then propagates to every follower
Can go to any replica directly
That replica accepts it; quorum (next chapter) keeps things straight, not a leader's authority
Replication factor (RF) is simply how many total real copies exist — the same real number Act 5's own Cassandra chapter already used concretely (RF 3 means three real copies, wherever they happen to live). It applies identically to either topology: a leader/follower system with RF 3 has one leader and two followers; a leaderless system with RF 3 has three equal replicas, any of which can accept a write directly.
GreenMart's own incident is genuinely easier to see clearly through this lens. Each region effectively behaved like its own local leader for its own local writes during the partition — not a designed leader/follower system working correctly, but the accidental effect of two regions each accepting writes independently, with neither one actually deferring to a real, agreed-upon authority. Whether GreenMart's real fix should be a genuine, disciplined leader/follower topology (one region truly in charge, always) or a leaderless one with real quorum enforcement (any region can accept a write, but only if enough others agree) is exactly the decision the next two chapters build the tools to make.
Key Takeaway
Leader/follower and leaderless aren't just implementation trivia — they're two genuinely different answers to "who's allowed to say a write is real." GreenMart's incident happened precisely because neither answer was actually chosen on purpose: each region acted with local, leader-like authority, without the real discipline (a genuine leader, or genuine quorum) either real topology would have required.
Why This Matters
This is the real, structural decision every remaining chapter in this Act assumes an answer to — quorum math (next chapter) means something different depending on whether there's a real leader in the picture, and consensus (later) is really about how a leader/follower system chooses its one real leader in the first place.
GreenMart now has real names for the two genuine ways replicated copies can be organized, and a precise, structural read on what actually went wrong in its own incident. How many of those real copies should actually have to agree before a write or read counts as trustworthy is exactly where the next chapter goes.
