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:
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.