skip to content
~11 min

Consistent, as CAP means it

Go back to an ordinary day, with the link working. Alice creates @nova and is told “ok, it's yours”. From that reply on, her change is confirmed.

This store copies Alice's change before it confirms it. Whichever data centre Bob then reaches, one answer is consistent.
AliceBerlincreate @nova3ok, it's yours1EU data centre@nova→Alicesaved2copied before the okboth answer as oneUS data centre@nova→Alicecopied4BobBostonis @nova free?5“taken”

A moment later Bob asks whether @nova is free, and his request reaches the other data centre. A consistent store may keep two copies, but never gives an answer that shows there are two. For such a store only one answer fits: “taken”.

definitionconsistent, in CAP

Every answer reflects every change already confirmed, whichever server gives it. The store behaves as if there were a single copy of the data.

The promise is about answers, not about copies. It does not say the two copies are equal at every instant. It says no answer misses a change confirmed before the request was made. And it starts at the confirmation: once Alice has her “ok”, any later lookup answered “free” breaks the promise.

Two other uses of the word are easy to mix in. The C of ACID, a database's promises about a transaction, says that one transaction leaves the data obeying its rules. And eventually consistent means only that the copies will agree some time after the changes stop. CAP's C is the promise above, and its exact name is linearizability.

eventually consistentconsistent, in CAP
the promiseThe copies agree some time after changes stop.Answers as if from one copy: none misses a change confirmed before its request.
just after Alice's “ok”“Free” is allowed, for a while.Only “taken” is allowed.
@novamay get two ownersone owner
in one line

In CAP, “consistent” means every answer reflects every change confirmed before its request, as if there were only one copy of the data.