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.

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store