AlgoViz

Consistency models for readers

medium 4 min

A read contract specifies which past writes a result must reflect.

Video lesson · Chapter 1 of 5

One draft, two devices

0:00 / 3:16

I saved my profile. Why did the old name come back?

1:01Reel

Theory

Read or listen first. About 1 min.

What it is

A replicated profile has more than one observable revision. A read contract specifies what a reader is entitled to see after a particular write or earlier read.

Can a customer see their own update?

CustomerPrimaryReplicaWrite v8Ack v8ReadRead v7A successful write can precede replication.
The write is acknowledged at revision 8 while a nearby replica still serves revision 7. Reading there can make the change appear to disappear.

Why it exists

An editor checking their own change needs continuity across requests. Tracking the latest acknowledged revision provides a concrete lower bound for that session’s next read.

Words to know

Read-your-writes
A session guarantee that a later read reflects the session’s completed writes or a newer state.

How it works

Step through the idea, or press Play.

Step 1 of 3

Remember the write. The client records the revision of its successful edit.

Understand it

Worked example

Consistency models for readers in practice

After editing a profile, a user reads from a lagging replica. A session revision can route or delay the read until that revision is available. A different viewer may still receive an earlier revision under this policy.

Related case

What can a disconnected region promise?

Three regions replicate a directory of active deployment versions. A network split leaves one region isolated. Engineers need to know which reads and writes may still succeed.

Three regional deployment boards
A rollout across three regionsRegion Arevision 11Region Brevision 11Region Crevision 11Three voters have revision 11

Fast reads can include a revision and age.

Sources