Amazing article!!!

Just a question about the kind of race condition, when some service tries to fetch a "new" read model, but it still was not updated in the db.

You are providing a versioning as an example:

GET /reads/orders/1337?v=3

But what if there was an other update to the read model, and the version is updated to be 4?

The event handler never success. So, to ensure it will work, I need either to store all the read model versions (sounds too much to me) or doing something like v >= 3, and maybe retry if the version in the read model db is still < 3. But it means I cannot just send the message to retry and process the next message, cause it will be out of the order (that can be somehow handled as a specific case with outOfOrder flag on the event).

My point is that I'm still cannot find a bulletproof solution for this problem :/

In GO we trust. Software Engineer.

In GO we trust. Software Engineer.