Reading — step 1 of 5
Read
~1 min readWhy Gossip
Anti-Entropy
Every node tracks a small set of {key, value, version}. Two nodes meeting:
- Each side sends a digest (key → version).
- Each requests keys it has older versions of.
- Other side sends those updates.
python
Versions break ties — concurrent updates need conflict resolution. Common approaches:
- Last-Write-Wins (LWW): timestamp-based. Simple; loses concurrent updates.
- Vector clocks: per-node version counters. Detect concurrency, surface conflicts.
- CRDTs (Conflict-free Replicated Data Types): merge automatically (sets, counters).
Cassandra uses LWW with timestamps. Riak supports vector clocks. SoundCloud's Roshi uses CRDTs.
Two flavors:
- Push: I send my updates to a peer.
- Pull: I ask a peer for their updates.
- Push-pull: both. Most efficient.
Discussion
Ask a question, share an insight, or help someone who’s stuck.
Sign in to post a comment or reply.
Loading…