intermediateBuilding the Query Side: Projections

What does 'eventual consistency' concretely mean in a system built with an Axon aggregate and a projection, and how should an API account for it?

Concretely, it refers to the small but real gap in time between an aggregate applying an event and the projection's @EventHandler method reacting to that event and updating its read model table. For most systems that gap is on the order of milliseconds, but it is never truly zero, since the event has to be published, delivered, and processed by the projection before the read model reflects it. If client code immediately issues a read right after a write completes, there's a genuine chance it reads stale or missing data, because the projection hasn't caught up yet. APIs built on this pattern should be designed with that window in mind — for example, having the write endpoint return enough information for a client to know a write was accepted without assuming an immediately following read will already reflect it, rather than treating a write as instantly visible everywhere.

Ready to master this question?

Generate a complete walkthrough — background, the full answer in plain language, a working code example explained line by line, a real-world scenario, common mistakes, and how this same question gets asked in different ways.

Sign in to generate a response

Next Step

Continue to Why is a projection's read model table considered disposable, and what practical benefit does that give a team?← Back to all Event-Driven Microservices questions