A Modular Monolith is a software architecture pattern that combines elements of both monolithic and modular architectures. In this approach, the application is built as a single, unified codebase like a traditional monolith, but it is designed and organized in a modular manner, allowing for logical separation of different components or modules within the codebase.
The Modular Monolith architecture is the “goldilocks” approach that combines the modularity of microservices with the simplicity of traditional Monoliths* Steve “Ardalis” Smith
Figure: Modular Monolith architecture
A Modular Monolith offers a balance between the simplicity and coherence of a monolith and the modularity and maintainability of more distributed architectures. It is particularly useful for certain kinds of applications and organizational contexts.
| Trade-Offs | Layered / CA | Microservices | Modular Monolith |
| Modularity | ❌ | ✅ | ✅ |
| Cost | $ | $$$ | $ |
| Scalability | ❌ | ✅ | ❌ |
| Simplicity | ✅ | ❌ | ✅ |