Skip to main content

How do event sourced systems make sure the read model is only updated once? [Resolved]

Currently looking into Event Sourcing in a Microservices architecture and I've found this article. It describes a possible implementation of CQRS and event sourcing.
If the logic dealing with updating the read model and creating the events are both implemented in the same (scalable) service, how does this architecture make sure that an event changing the read model is only handled once?

To clarify with the example used in the article:*kyDtZ3pq6ht3Zp5C5ksTvQ.png If the User Management Service is scaling, leading to multiple instances running at the same time, how can it be ensured that the logic doesn't add the same user twice?

One solution I can think of is completely splitting every Microservice into one read- and one write-service and only scaling the read service, but that doesn't sound optimal.

Question Credit: Torsten N.
Question Reference
Asked August 28, 2018
Posted Under: Programming
2 Answers

Your Answer