Understanding the role of messages in a modular monolith
One of the fundamental steps in moving from a monolithic architecture to a microservice-based solution is to adopt events to facilitate communication between different modules. Introducing events into a modular architecture can significantly enhance the design by enabling systems to be more loosely coupled, scalable, and reactive. Of course, as discussed in previous chapters, every architectural change comes with trade-offs. Replacing synchronous communication with asynchronous event-based messaging introduces a new set of challenges, which can be summarized as shown in Table 7.1:
Aspect |
Event-Driven |
Direct Communication |
Communication |
Asynchronous Decoupled |
Synchronous Tightly... |