I am working to grok how an entire system built with Event Sourcing, CQRS, and Microservices go together.
first, am I thinking of this correctly?
Let’s say I have a system that keeps track of banking records and the following actions:
CreateAccountCmd --> AccountCreatedEvent I have 2 subscribers to that event. 1) a normalizer service to query, 2)a microservice that sends out a “Welcome” email.
UpdateAccountCommand --> AccountUserNameChangedEvent again, 2 subscribers, 1)the normalizer, 2) another email service.
AccountDepositCommand --> AccountAddedMoneyEvent 1)the normalizer
AccountDepositCommand --> AccountAddedMoneyEvent 1)the normalizer
AccountDepositCommand --> AccountAddedMoneyEvent 1)the normalizer
Now I can query the normalizer for the balance, Is this correct?
I need to put a security feature into place, in which 3 consecutive deposits sends out an alert.
I feel like I should be pulling from Event Store, but how do I “Prime the pump” replaying the events for the new Microservice without sending out the emails all over again?
I might be missing something completely, please don’t hesitate to point me to an article that talks about this type of thing
Thanks
Tal