Distributed systemsread your writesread-after-write consistencysession consistency

Read-your-writes consistency

Definition

Read-your-writes consistency guarantees that a client which has completed a write will see that write (or a newer value) in all its subsequent reads; it says nothing about other clients.

In practice

With asynchronous replicas or a CQRS read model, a user can save a profile and then reload a page served from a replica that has not caught up, so the change seems lost. Typical fixes are reading from the leader for a short time after a write, routing the user to a replica at least as fresh as their last write position, or updating the UI from the write response.

It is a per-user guarantee, cheaper than linearizability, and often all a product needs. Watch for cross-device cases: a write on a phone followed by a read on a laptop needs the freshness token stored server-side, not in the device session.

Example

After a user posts a comment, the API stores the commit LSN 0/3A1F2B8 in their session and serves their next reads only from replicas that have replayed at least that position.