0 day streak
9. Distributed systemsGossip and CRDTs

Gossip and CRDTs

Gossip is a way to spread information through a large cluster without a central coordinator: every so often each node picks a few random peers and swaps what it knows, so news reaches everyone in a handful of rounds even with thousands of nodes, much like a rumor moving through an office. Systems such as Cassandra use it to share membership and spot failed nodes. CRDTs, short for conflict-free replicated data types, pair well with it: they’re data structures designed so each replica can accept updates on its own and the copies still merge to the same result, whatever order the merges happen in. A grow-only counter, for example, keeps a separate count per node, merges by taking the larger value for each node, and reports the sum. You get eventual consistency without writing conflict-resolution code.

In this lesson: Gossip as infection spread. CRDT counters merging after a partition heals.