← Lessons

quiz vs the machine

Gold1450

System Design

Gossip Protocol

Spreading cluster state the way a rumor spreads through a crowd.

5 min read · core · beat Gold to climb

Spreading state without a leader

A gossip protocol lets a cluster share information without any central coordinator. On a fixed interval each node picks a few random peers and exchanges what it knows: who is alive, who is dead, and recent metadata. Over many rounds every fact reaches every node.

The spread is epidemic: each informed node infects a few more each round, so information reaches the whole cluster in a number of rounds that grows only with the logarithm of the cluster size.

Why teams like it

  • Scalable because each node talks to only a handful of peers per round.
  • Robust because there is no single coordinator to fail.
  • Eventually consistent because all nodes converge given enough rounds.

The cost is that updates are not instant and there is a small steady stream of background chatter.

Gossip commonly carries failure detection with heartbeats: if no node has heard from a peer recently, the cluster marks it suspect and then dead.

Key idea

Gossip spreads cluster knowledge through random peer exchanges, scaling without a leader at the cost of delayed convergence.

Check yourself

Answer to earn rating on the learn ladder.

1. How does a node spread information in a gossip protocol?

2. What is a main advantage of gossip over a central coordinator?