Replication lag and stale reads 00:00:01 A confirmed order vanishes on refresh The order confirmation is printed. The customer hits refresh and the order disappears. Ezra draws two requests to two different machines. A successful write at the primary does not say which updates a replica has already replayed. The selected replica starts level with the primary. During the incident its replay position falls forty-two binary megabytes behind. That is a distance in the log. Turning it into seconds would require knowing how quickly new log is generated and replay progresses. Replication separates log creation, transport, durability on a replica and replay into visible state. A primary may acknowledge before a particular reader can see its change. 00:00:49 Mark the write position and the replica's replay point Byte lag indicates work outstanding. Time lag also depends on workload, reporting and replay progress. Read scaling introduces a visibility contract as well as extra capacity. The primary assigns the operation a log position. A replica receives log bytes and may persist them before applying the change. The replica makes the update available to eligible new snapshots. A session uses a caught-up reader or the primary to meet its visibility promise. 00:01:21 Choose a reader that has applied this order If the replica has received the bytes containing this order, can Ezra already promise that an ordinary read there will return it? Distinguish receiving log from replaying it into the readable state. Carry the write's position and choose a reader whose applied position reaches it, or use the primary for this session. A different workload may tolerate an earlier snapshot. If the selected reader has applied the write, check transaction snapshot age, cache keys and whether the read targeted the correct tenant. 00:01:53 Separate bytes behind from seconds behind The measured replay gap later narrows to one binary megabyte. One leader accepts writes for an assigned range and propagates changes to followers. Failover requires authority and a decision about which acknowledged history must survive. Ezra checks the specific order position again. Read-your-writes becomes testable when a request carries a freshness requirement and the chosen reader can satisfy it.