Implementing a Modular Monolith
Planning is essential before building a Modular Monolith. We must consider what each module does and how modules work together. A good plan helps us avoid problems later on.
Choosing the right tools to create a lean stack is also essential. The good news is that we don’t need to define a large shared stack since each module is independent. Like a slice in Vertical Slice Architecture, each module can determine its patterns and data sources. Yet, we must define a few common elements to assemble a Modular Monolith successfully. Here are a few items to consider to improve the chances of success of a Modular Monolith:
- The modules share the URL space
- The modules share the configuration infrastructure
- The modules share a single dependency injection object graph (one container)
- The modules share the inter-module communication infrastructure (event broker)
We can address the first two elements using the module...