Gossip Protocol
TechniqueDistributed SystemsMidSeniorUpdated
Each node periodically picks a random peer and exchanges state. Information spreads epidemically in O(log n) rounds with bounded per-node bandwidth.
When to Use Gossip Protocol
Membership, failure detection, and cluster metadata where eventual convergence is fine and you want no central coordinator. Scales to thousands of nodes.
In Practice
Cassandra's cluster membership, Consul's SWIM-based serf layer, Redis Cluster's gossip bus, and HashiCorp Memberlist all use gossip for liveness and config.
How Gossip Protocol Comes Up in Interviews
Scenario
A 2000-node Cassandra-like cluster needs every node to learn about joins, leaves, and failures without a central coordinator.
Gossip spreads membership and heartbeat state to O(log n) hops with constant per-node bandwidth. Raft would bottleneck on the leader, and chain replication does not address membership.
SWIM (used by HashiCorp Serf and Consul) refines gossip with indirect pings and suspicion timeouts, cutting false positives during partial network blips.