Consistency

A consistency rule says which version of the data a read can return. A replica can be 0.1 s or more behind the leader, so a read there can miss a write that just ended. Rules such as read-your-writes limit which old versions a user can see.

Play a level

See it on the board

The same traffic runs on two boards. The simulator measured both when this page was built.

Board to show
SQLUsersPostgres2 vCPU · 2 GB × 3
SQLUsersPostgres2 vCPU · 2 GB × 3
Reads from a copy 2 s behind: misses a goal
SQLUsersPostgres2 vCPU · 2 GB × 3
SQLUsersPostgres2 vCPU · 2 GB × 3
Read-your-writes on: meets the goals
See it on the board
Measure Goal Reads from a copy 2 s behind Read-your-writes on
Missing own writes none 34,846 Fail 0 Pass
p99 latency under 100 ms 25 ms Pass 25 ms Pass
Monthly cost 24 USD/mo 24 USD/mo
Error rate 0% 0%

Key numbers

Default database settings from the catalog. The simulator uses the same values.
NumberValue
Delay of an async copy, default0.1 s
Database read (Postgres), median0.5 ms
Copies that answer each read, key-value store1 copies
Copies that confirm each write, key-value store1 copies
Read and write quorumsLeft and right arrows change R. Tap to change W.

W 3 + R 3 of 5 · every read sees the last write

How it works

When data has copies, a read can reach a copy that does not have the latest write yet. If that is a problem depends on the promise that the system makes.

Strong consistency means that each read sees the latest confirmed write, as if there were only one copy. It needs coordination: reads go to the leader, or to enough copies to include the latest one. With N copies, a write to W copies and a read from R copies always overlap when R plus W is more than N.

Eventual consistency only promises that the copies agree when writes stop. Reads are fast and stay available, but a user can see old data for a short time.

Between these two are rules for each user. Read-your-writes means that a user always sees their own last write. Monotonic reads mean that a user never sees older data after newer data. These rules cost less than strong consistency, and they match what users notice: their own post must not go away after they save it.

Each stronger rule costs latency or availability. A read that must find the latest copy waits longer, and it can fail when the copies cannot reach each other.

In the levels you choose the read rule that each use needs, and pay only for the guarantees that matter.