Suppose one person in a city of a million learns a secret. If they whisper it to one random stranger every minute, who each whispers it to one random stranger the next minute, how long before the whole city knows?
The answer is about 20 minutes — because each round the number of informed people doubles. This exponential growth is the engine behind gossip protocols, one of the most elegant tools in distributed computing.
A gossip protocol works exactly like a rumor: each node that knows a piece of information picks one random neighbor and sends it the update. In the next round, every newly informed node does the same. The information spreads like an epidemic through the network.
The remarkable mathematical guarantee — proved rigorously in the 1980s by Alan Demers and colleagues — is that after rounds every node in an N-node network has received the information with high probability. No central coordinator, no global view of the network, no single point of failure. Just local randomness, compounding into global certainty.
This article explains why is the right answer, how to see it in action, and why that simple whispering strategy powers everything from distributed hash tables to the databases that back your favorite apps.
Comments
Loading comments...