Hello Bert,
Thank you for such a comprehensive answer at such short notice! I took the time to forward your response to the team, and actually tried to come up with a diagram that would better describe our situation.
This part of your answer would best describe what our current monolithic architecutre is doing, and what we will be using in this new one as well, since the ERP system is more of a third-party system rather than our own.
To elaborate on the diagram. Currently this A entity is the Client. The Central App currently runs a synchronization process during which new data is pulled from the ERP and persisted inside our own system. This Client Aggregate contains data that are manipulated and used throughout our whole system by all the microservices. Whenever The Central App receives updates about the Clients, it will notify the microservices to individually record these changes. Upon reflecting on this scenario, your suggestion,
Seems to be the answer we were looking for. However, I would like to know if I understood it correctly:
You are suggesting that we should maintain this Aggregate only in the Central App and make all the other Microservices aware of the Central App Event Store. This way, whenever the synchronization for a Client succeeds, by using the Distributed Command Bus (which I forgot to mention we are already using) we could send simpler Commands, containing something like the client’s ID for every microservice. Each MS will in turn perform EventSourcing for that Client’s ID directly from the Central EventStore, thus skipping the overhead of a separate implementation of the same aggregate?
Additionally, I would like to point out that different microservices operate on different models from our domain, hence our implementation of different aggreagets and event stores inside each microservice (as is the case with B,C and D in the diagram. These can be created, updated and deleted from specific microservices only, but the changes should be reflected in the central app as well. Would you advise against this in favour of directly forwarding the commands to the central app?
But won’t such an approach be a little too much to handle for the central EventStore in terms of performance with so many transactions going on, thus impacting the overall availability?
I am looking forward for your answer and kind regards!