We use analytics cookies.We use cookies to analyze site traffic and improve your experience.
Loading...
System Design Masterclass · Data Replication Distribution
Free preview: the first 2 parts of this 7-part lesson.
Already bought the course? Sign in to read the whole lesson.
this lesson is part of
System Design Masterclass
Unlock this lesson and the 751 other paid lessons
$25 once, by PayPal
See the System Design courseread the rest of this lesson in
System Design Masterclass
Unlock this lesson and the 751 other paid lessons
$25 once, by PayPal
See the System Design coursein Data Replication Distribution
This lesson is part of the full System Design Masterclass. Unlock it along with 769 other lessons for a one-time payment.
One-time payment by card or PayPal
Get Lifetime AccessOne-time payment: UPI, card or netbanking
Get Lifetime Access18 Foundation lessons are free, no payment needed. Try them now
It is easy and good
“It is really nice and good Please join the course”
Imagine five database nodes arranged in a circle. Node A replicates to Node B, B replicates to C, C to D, D to E, and E back to A. Every node has exactly one upstream and one downstream. Clean. Symmetric. Balanced.
Ring topology was popular in the early days of distributed databases, particularly in multi-master setups where any node could accept writes. Apache Cassandra's earliest versions used a ring for data distribution. Token Ring networking (IEEE 802.5) ran many enterprise LANs in the 1980s and 1990s before Ethernet killed it. IBM's mainframe clustering relied on ring communication for decades.
The appeal is obvious: no single node bears the full burden. Each node only replicates to one neighbor, so the load is evenly distributed. In a star topology, the primary replicates to all replicas simultaneously. In a ring, each node only replicates to the next one in the chain.
But ring topology has a fatal flaw that's made it largely obsolete for most database replication use cases. We'll get to that.
Each node in the ring receives data from its predecessor and forwards it to its successor:
Change propagation through the ring takes N-1 hops for N nodes. In a 5-node ring, a write on Node A takes 4 hops to reach Node E. Each hop adds : network transfer time plus the receiving node's apply time. If each hop takes 5ms, the farthest node is 20ms behind the writer. In a 10-node ring, that becomes 45ms.
Loop prevention relies on originator IDs. Each write carries the node ID of the original writer. When a node receives a write that it originally sent, it discards it instead of forwarding again. Without this, a single write would circle the ring forever.
Conflict detection uses timestamp-based last-write-wins or version vectors. Each write carries an originator ID and timestamp. Nodes that receive a change check if they've already seen a newer write for the same key and skip it if so.
| Ring Size | Hops to Reach All | Max Propagation Delay (5ms/hop) |
|---|---|---|
| 3 nodes | 2 hops | ~10ms |
| 5 nodes | 4 hops | ~20ms |
| 10 nodes | 9 hops | ~45ms |
| 20 nodes | 19 hops | ~95ms |
Propagation delay grows linearly with the number of nodes. This is manageable for small rings but becomes a real consistency problem at scale. A 20-node ring means the farthest replica is nearly 100ms behind the writer.