# Modular Monoliths

> Resources for learning about modular monoliths

## What is a Modular Monolith?

A modular monolith is an architectural approach that combines the simplicity of monolithic deployment with the organizational benefits of modular design. It allows teams to build well-structured applications that are easier to maintain and refactor.

Unlike traditional (often messy) monoliths, a **modular** monolith enforces boundaries between modules, making it possible to evolve the system over time—potentially even extracting services when needed.

## What is a Module?

A module is an encapsulation boundary that maps to a [bounded context](https://deviq.com/domain-driven-design/bounded-context). Modules encapsulate their internal behavior and implementation details, including their data model. While many monolithic applications make use of a [layered architecture](https://deviq.com/) or [n-tier architecture](https://deviq.com/), these layers are *horizontal* and do not enforce encapsulation across logical contexts. The result that even when followed "correctly", many monolithic apps that rely solely on layered architecture patterns end up devolving into a [big ball of mud](https://deviq.com/antipatterns/big-ball-of-mud).

## Why Choose This Approach?

- **Simpler deployment** than microservices
- **Clear boundaries** between business domains
- **Easier debugging** and testing
- **Lower operational complexity** no distributed application; minimal out of process dependencies
- **Path to microservices** when (or if!) needed

### Start Simple

Begin with a well-structured monolith. Define your modules based on business capabilities and enforce boundaries from day one.

### Scale When Ready

As your team and application grow, you can extract modules into separate services. The modular structure makes this transition smoother.

### Learn Continuously

Explore patterns, best practices, and real-world examples to help you build better modular systems.

## Approaches

Opinionated, end-to-end approaches to building modular monoliths

- [Encapsulated Module Architecture (EMA)](https://modularmonoliths.com/approaches/encapsulated-module-architecture/): An opinionated approach to building modular monoliths with strongly encapsulated modules

## Patterns

Architectural patterns for building modular monoliths

- [Explicit Contract Projects](https://modularmonoliths.com/patterns/explicit-contract-projects/): Giving each module a separate contracts project to prevent circular dependencies
- [Event-Based Consistency](https://modularmonoliths.com/patterns/event-based-consistency/): Keeping data in separate modules consistent using integration events instead of distributed transactions
- [Integration Events](https://modularmonoliths.com/patterns/integration-events/): Communicating between modules using events
- [Module Boundaries](https://modularmonoliths.com/patterns/module-boundaries/): How to define and enforce boundaries between modules
- [Shared Kernel](https://modularmonoliths.com/patterns/shared-kernel/): Sharing common code across modules safely

## Resources

Books, courses, articles, podcasts, and talks about modular monoliths

- [Courses](https://modularmonoliths.com/resources/courses/): Online courses and training on modular monolith architecture
- [Videos](https://modularmonoliths.com/resources/videos/): Conference talks and video tutorials on modular monoliths
- [Podcasts](https://modularmonoliths.com/resources/podcasts/): Podcast episodes about modular monoliths
- [Articles](https://modularmonoliths.com/resources/articles/): Blog posts and articles about modular monoliths
- [Books](https://modularmonoliths.com/resources/books/): Recommended books on modular architecture

---

Source: https://modularmonoliths.com/
