What it is
A gossip protocol spreads state across a cluster without any central coordinator. Each node periodically picks a random peer and exchanges what it knows. Like a rumor, information reaches everyone in a number of rounds that grows only logarithmically with cluster size.
Why presence uses it
A presence system across many nodes must agree on who is online. Gossip distributes this membership cheaply and tolerates node failure, because no single node is responsible for the whole picture.
- Each node tracks a heartbeat counter per member.
- On each round it merges its view with a peer, keeping the highest counter seen.
- A member whose counter stops rising is eventually marked failed.
Tradeoffs
- State is eventually consistent, so two nodes may briefly disagree.
- Gossip uses constant bandwidth per node regardless of cluster size.
- Tuning the round interval trades convergence speed against traffic.
Key idea
Gossip spreads presence and membership by having each node exchange heartbeat counters with random peers, converging the whole cluster cheaply and tolerating failure without a coordinator.