# Monolith, Modular Monolith and Microservices

> Weigh the real costs and benefits of monoliths and microservices, and learn how teams split systems along business boundaries when they need to. Free notes,...

Canonical: https://www.internhack.in/roadmaps/tracks/system-design/monolith-vs-microservices
Last updated: 2026-11-28

Weigh the real costs and benefits of monoliths and microservices, and learn how teams split systems along business boundaries when they need to.

Intermediate · about 3 hours · difficulty 3/5

Learn first: [API Design: REST, gRPC and GraphQL](https://www.internhack.in/roadmaps/tracks/system-design/api-design), [Message Queues and Async Processing](https://www.internhack.in/roadmaps/tracks/system-design/message-queues)

"Should this be microservices?" is one of the most common design questions and one of the most over-answered with "yes".

### Monolith

One deployable application with one codebase and usually one database. **Simple** to build, test, deploy and debug; transactions are local; no network calls between modules. Scales well horizontally behind a load balancer. Many large Indian products ran as monoliths far longer than people assume.

### Modular monolith

Still one deployable, but with **strict module boundaries** (separate packages, owned tables, internal APIs between modules). You keep the operational simplicity while preparing clean seams for later extraction. Often the best default.

### Microservices

Many small services, each owning its data and deployed independently. Benefits:

- **Team autonomy**: 20 teams can ship without coordinating one release.
- **Independent scaling** and technology choice per service.
- **Fault isolation**, if designed for it.

Costs:

- Network calls everywhere: latency, partial failures, retries.
- **Distributed data**: no joins or ACID transactions across services; sagas and eventual consistency.
- Operational load: service discovery, tracing, CI/CD per service, versioned contracts, on-call for each.

### How to split

Use **domain-driven design** ideas: find **bounded contexts** (catalog, cart, orders, payments, delivery) where language and data are cohesive. Each service owns its data; others access it only through APIs or events. Use the **strangler fig** pattern to extract pieces from a monolith gradually.

### Pitfalls

- A **distributed monolith**: services that must deploy together and share a database.
- Splitting by technical layer (a "DB service") instead of business capability.
- Five services for a three-person startup.

You are ready to move on when you can argue for a modular monolith for an early-stage startup and for microservices at Swiggy's scale, using team size, deploy frequency and data ownership as reasons.

## Key concepts

- **Monolith strengths**
- **Modular monolith**
- **Microservices benefits and costs**
- **Bounded contexts (DDD)**
- **Database per service**
- **Strangler fig migration**
- **Distributed monolith anti-pattern**

## Mini project

Take a monolithic e-commerce app (yours or an open-source one), draw its bounded contexts, and write a migration plan that extracts one context (for example notifications) using the strangler fig pattern, including data ownership changes.

## Check yourself

Name three signs that a set of microservices is actually a distributed monolith.

## Free resources

- [Microservices](https://martinfowler.com/articles/microservices.html) (Martin Fowler)
- [MonolithFirst](https://martinfowler.com/bliki/MonolithFirst.html) (Martin Fowler)
- [Microservice architecture patterns](https://microservices.io/) (microservices.io)
- [Strangler fig application](https://martinfowler.com/bliki/StranglerFigApplication.html) (Martin Fowler)

Previous: [Idempotency, Retries and Timeouts](https://www.internhack.in/roadmaps/tracks/system-design/idempotency-and-retries) · Next: [Service Communication and Discovery](https://www.internhack.in/roadmaps/tracks/system-design/service-communication)

## More in Architecture Styles and Service Communication

- [Monolith, Modular Monolith and Microservices](https://www.internhack.in/roadmaps/tracks/system-design/monolith-vs-microservices)
- [Service Communication and Discovery](https://www.internhack.in/roadmaps/tracks/system-design/service-communication)

## Related

- [Roadmaps](https://www.internhack.in/roadmaps)
- [System Design Roadmap](https://www.internhack.in/roadmaps/tracks/system-design)
