← Lessons

quiz vs the machine

Platinum1790

System Design

Chain Replication

Arranging replicas in a line so writes flow head to tail and reads always hit the tail.

5 min read · advanced · beat Platinum to climb

The layout

Chain replication organizes the replicas of a partition into an ordered chain. The first node is the head, the last is the tail, and the rest are middle links.

  • Writes enter at the head and propagate down the chain, each node forwarding to the next.
  • A write is only acknowledged once it reaches the tail.
  • Reads are served entirely by the tail.

Why this gives strong consistency

Because the tail acknowledges writes and also serves all reads, a read at the tail can only return a value that has been committed through the entire chain. There is no window where a read sees an uncommitted write. This delivers linearizable reads with a simple rule.

The tradeoffs

  • The design separates load: writes stress the head, reads stress the tail, balancing work differently than a single leader.
  • Failures require reconfiguring the chain. If a middle node dies, the chain is spliced. If the head or tail dies, a neighbor takes over, coordinated by a separate control plane.
  • Write latency grows with chain length, since the write must traverse every link.

Key idea

Chain replication routes writes through a head to tail line and serves reads from the tail, giving strong consistency with a simple rule.

Check yourself

Answer to earn rating on the learn ladder.

1. Where do reads happen in chain replication?

2. Why does chain replication give strong consistency?