Why it matters

Membership is foundational for cluster services. Gossip approach scales well; understanding enables its use.

Advertisement

The architecture

SWIM: Scalable Weakly-Consistent Infection-Style Membership. Periodic pings + gossip.

Serf: HashiCorp's SWIM implementation.

Gossip membershipPing random peerdetect failureGossip changesspread through clusterConsistent viewover timeO(log n) rounds to converge; failure detection via indirect pings
SWIM protocol.
Advertisement

How it works end to end

Failure detection: periodic pings. If no response, indirect ping via third party. If still no response, suspect.

Rumor spreading: news of membership changes spreads via gossip.

Convergence: O(log n) rounds with high probability.