ELI5 · Distributed systems

Eventual consistency.

Gossip: tell one person, and given a little time, everyone hears the news.

When data is copied across many machines, keeping every copy identical at every instant is slow — you would have to wait for all of them to confirm each change before moving on.

Eventual consistency takes the relaxed route. A change lands on one copy, then spreads to the others in the background, like a rumour passing through a town. For a short while people disagree; soon everyone has heard.

  1. Did you hear?
    news!
    1

    A bit of news arrives and lands on one person right away. No waiting for the rest of town.

  2. psst
    2

    She passes it to a neighbour, who passes it on. The rumour spreads quietly in the background.

  3. Heard what?
    ? ? some know, some don’t
    3

    For a short while the town disagrees: some have heard, some haven’t. Ask two people, get two answers.

  4. hopping along
    4

    The news keeps hopping from person to person, reaching further with each retelling.

  5. all heard — converged
    5

    Soon everyone has heard the same thing. The copies have converged.

  6. fast write no waiting brief gap copies differ
    6

    The trade: writes stay fast and nobody waits, in exchange for a brief window where copies differ.

News spreads like a rumour: one person hears it, and soon the whole town has.

The trade you are making

In return for that brief window of disagreement, you get speed and availability: writes are fast because they do not wait for everyone, and the system keeps working even if some replicas are unreachable.

The opposite end is strong consistency, where every read is guaranteed the latest value — correct, but slower and more fragile when machines lose contact.

When it is fine, and when it is not

Eventual consistency is perfect where a few seconds of staleness is harmless: like counts, view counters, social feeds, a friend’s status. If your like shows up a moment late, nobody is hurt.

It is a poor fit where the latest value must be exact every time — a bank balance, remaining stock of the last item. There, you pay for stronger guarantees on purpose.

The real version Replication, in depth →
Found this useful?