The lag is built in
In CQRS the command side writes, then events flow to projections that update read models. There is a moment between a successful write and the read model reflecting it. During that window a query may return stale data. This is eventual consistency.
Why it happens
- The write commits first.
- An event is published and delivered asynchronously.
- A projection processes it and updates the view.
Each hop adds delay, usually small but never zero.
Designing around it
- Set expectations in the interface, such as showing your change is processing.
- Read your own writes by returning the new value from the command response or reading from the write side briefly.
- Version or timestamp read models so a client can tell if its update has landed.
Key idea
CQRS read models update asynchronously, so accept a small staleness window and design the interface to handle reads that have not caught up yet.