AlgoViz

Consistency models

hard 30 min

A consistency model is the promise a replicated store makes about what a read may return.

Where it shows up

The same pattern appears across everyday software.

  • etcd

    Linearizable by default through Raft. A client may ask for serializable reads, which are local, faster and possibly stale.

  • ZooKeeper

    Writes are linearizable, reads sequentially consistent. Its documents place the whole between the two and name it ordered sequential consistency.

  • MongoDB sessions

    Causally consistent sessions, with majority read and write concern, give a client an order that follows cause and effect even when reading from secondaries.

  • Azure Cosmos DB

    Five named levels: strong, bounded staleness, session, consistent prefix and eventual. The level can be relaxed for a request.

  • Amazon S3

    Reads after a write of an object are strongly consistent, which shows that object stores need not be eventual.

  • DNS

    Resolvers keep answers for their time to live. A changed record is seen by different people at different times.