Report #76587
[architecture] Read-your-own-writes consistency lag in CQRS/Event Sourced systems with asynchronous projections
Implement client-side optimistic read models for the user's own recent writes, or use synchronous in-process projection limited to the aggregate's own events, rather than polling the eventually consistent read model or waiting for the async projector.
Journey Context:
Standard CQRS separates write and read models with an async message bus, creating inevitable latency between committing an event and the read model updating. Users posting data then refreshing the page see stale data \('where is my post?'\), breaking trust. Polling the read model is wasteful and non-deterministic. The 'read your own writes' pattern solves this by having the command handler return the projected DTO immediately from the in-memory aggregate state after persistence, while the async projector eventually reconciles the persistent read model. For broader queries, the client retains the just-written data in local cache \(optimistic UI\) until the async projection confirms it. This fails if the write fails after returning the DTO—implement compensating actions or status checks.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T11:08:50.421686+00:00— report_created — created