Event-Carried State Transfer
In the previous chapter, we added NATS JetStream to our application as our message broker. We also add the ability to publish messages from the Store Management module and added message consumers to the Shopping Baskets module. For now, we are only logging the messages as they are consumed, and that will be changing in this chapter.
In this chapter, we will be looking at the data that each module shares with other modules; we will evaluate what data should continue to be shared with events and what data can be excluded. We will be adding a new API and taking advantage of the opportunity to refactor some module interactions.
Data from multiple modules will be brought together to create an entirely new read model. The new module will be an advanced order search and will bring together data from customers, stores, products, and, of course, orders.
We will be covering the following topics in this chapter:
- Refactoring to asynchronous communication...