Skip to Content
Mengty Learns
Architecture

Monolith vs Modular Monolith vs Microservices

Weigh the honest costs of distributed systems, team topology (Conway's Law), and why starting with a modular monolith is the default choice.

explanationintermediateTested with typescript 7.0.2Updated Nov 27, 2026

TL;DR

Start with a Modular Monolith. Microservices buy organizational scaling and independent deployment, not cleaner code—and they charge a steep tax in network failures, distributed tracing, and eventual consistency. Extract a service only when a specific scaling, runtime, or team-autonomy bottleneck proves you need it.

Context

Many teams adopt microservices on day one hoping it will keep code modular. In reality, if you can't draw clean module boundaries inside one repository, splitting them across HTTP/gRPC creates a distributed monolith—all the coupling of a bad monolith plus network latency and partial failures.

Comparison

DimensionBig-Ball-of-Mud MonolithModular MonolithMicroservices
Module boundariesTangled imports & shared tablesStrict public APIs, isolated schemasNetwork APIs + separate databases
CommunicationDirect function callsPublic module interfaces / in-process eventsHTTP/gRPC + message brokers
ConsistencySingle ACID DB transactionSingle ACID DB transaction (or local events)Eventual consistency (Outbox / Sagas)
DeploymentOne artifactOne artifactN independent pipelines & versions
Ops complexityLowLowHigh (service mesh, tracing, retries, DLQs)
Best team size1–3 devs (short-lived)2–30+ devsMultiple autonomous teams (30+ devs)

Decision criteria

  1. Team topology (Conway's Law): If 1–2 squads ship the product, one modular monolith lets everyone refactor atomically in one PR. Microservices pay off when 5+ teams step on each other's release trains.
  2. Independent scaling or runtime: A video transcoder or Python ML inference service genuinely benefits from being its own deployable worker; your CRUD billing module usually doesn't.
  3. Domain maturity: Early-stage domains change boundaries weekly. Moving a function across folders takes 10 seconds; moving an API across two microservices takes weeks.

Gotchas

  • Microservices for "clean code": network boundaries don't fix unclear domain modeling—they just make refactoring 10× slower.
  • Synchronous call chains: Service A → Service B → Service C → Service D multiplies tail latency and turns a 99.9% SLA per service into cascading outages.
  • Shared database across microservices: if two microservices share one Postgres database, you built a distributed monolith with extra steps.

Production checklist

  • Default to a Modular Monolith unless you have a concrete team, scaling, or compliance driver
  • Enforce module boundaries with lint rules and separate DB schemas so extraction stays possible
  • If you extract a service, give it its own database and use async events/outbox where possible

Check yourself

Check Yourself

1. A 5-person startup splits their new SaaS into 8 microservices so the code stays clean. What is the most likely outcome?

2. What is a 'distributed monolith'?

Sources