skip to content
~11 min

Neither CP nor AP

So far KataTube looked like a CP store: during a cut its US side refuses to create channels. But creating is not all the US side does. It also answers lookups, such as “is this handle free?”, from its own copy, and goes on doing so while the link is down. Bob makes two requests to it.

The US data centre during a cut, two requests. The lookup gets a stale answer and the change gets an error, so the store is neither consistent nor available.
AliceBerlinowns @novaKataTube · EUcreates channels@nova→AliceKataTube · USlookups only@nova→freeBobBoston1is @nova free?“free”: stale, not Consistent2create @nova“try later”: an error, not Availableso: neither CP nor AP
  • He asks whether @nova is free, and is told “free”. Alice took it a minute ago in the EU. The answer is stale, so this store is not consistent.
  • He asks to create @nova, and is told “try later”. A running server has answered with an error, so this store is not available.

Taken whole, it is neither CP nor AP. Under CAP's strict definitions many real stores are like this, and that is no defect: it means only that the two labels do not describe the store. In KataTube, a stale lookup harms nobody, and no handle ever gets two owners.

The labels fail for a second reason too: one store can choose differently for each request. PACELC, a lesson of its own, shows how.

in one line

Many real stores are neither CP nor AP: their copies may answer stale, so they are not consistent, and one side refuses changes in a cut, so not available either.