Eventual Consistency
A user saves a change, refreshes the page and still sees the old data. In event-driven systems, the read side is updated a moment after the write, so for a short time different parts of the system disagree. That’s eventual consistency. You can’t remove the delay, but you can make sure the data ends up correct and that users aren’t confused while they wait.
The first article builds read models in MongoDB and shows how to keep them correct when events are delayed or delivered twice. The second shows long-polling: the API waits briefly until the change is visible, so the client can treat an asynchronous operation as if it were synchronous.
Read them in order; the second builds on the first.

Dealing with Eventual Consistency and Idempotency in MongoDB projections
2021-11-10Auditability, diagnostics, time travelling are usually the first mentioned features when speaking about Event Sourcing. All of them are great, but to me, projections are…
Long-polling, how to make our async API synchronous
2021-11-17I’ll continue today a topic of handling eventual consistency that I started in the previous article. This time let’s learn the trick called “long-polling”. It helps in…