Archprimer
TradeoffIntermediate 9 min read

Monolith vs Microservices

A monolith is one deployable unit that is simple to build and operate; microservices split it into independently deployable services that scale teams at a cost of distributed complexity.

architecturemicroservicesmonolithteam-scaling

By Ratish Jain · Updated

Diagram with 5 components: Client, Monolith, API Gateway, Orders Svc, Users Svc. Connections: Client → Monolith (all calls); Client → API Gateway (route); API Gateway → Orders Svc (call); API Gateway → Users Svc (call).
ClientServiceGateway
One deployable process versus many independent services.

The Decision

A monolith packages all functionality into a single deployable application, typically sharing one database. It is simple to develop, test, deploy, and debug: one codebase, in-process calls, easy transactions. The downsides appear at scale — the codebase grows tangled, every change redeploys the whole app, and one team's mistake can crash everything.

Microservices decompose the system into small, independently deployable services, each owning its data and communicating over the network. This lets many teams ship autonomously and scale hot paths independently, but you inherit the full weight of distributed systems: network failures, eventual consistency, and operational overhead.

So it depends on organizational scale and complexity: start with a monolith, and adopt microservices when team and domain boundaries demand it.

Side by Side

MonolithMicroservices
DeploymentOne unitMany independent units
DataUsually one shared DBDatabase per service
CommunicationIn-process callsNetwork (HTTP/gRPC/events)
Team scalingContention on one codebaseAutonomous per-service teams
ScalingWhole app togetherPer-service, targeted
TransactionsSimple ACIDSagas, eventual consistency
Failure blast radiusOne fault can down allIsolated, needs resilience patterns
Ops overheadLowHigh (infra, observability)

Microservices Strengths & Weaknesses

Pros
  • Independent deployment lets teams ship without coordinating releases
  • Scale and optimize only the hot services, in the right language
  • Fault isolation with patterns like circuit breakers and bulkheads
Cons
  • Distributed-systems complexity: network faults, retries, tracing
  • Cross-service transactions need sagas and eventual consistency
  • Heavy operational cost — CI/CD, service mesh, observability per service

Decision Guide

Decision Guide

Choose a monolith for new products, small teams, and unclear domain boundaries — it is faster to build and easier to change while you learn. Move toward microservices when the team grows past what one codebase can coordinate, when parts of the system need independent scaling or release cadence, and when domain boundaries are well understood. A well-modularized monolith is a strong middle ground and a clean starting point for later extraction.

Real-World Examples

Amazon
Broke a monolith into thousands of services as it scaled
Netflix
Migrated to microservices on AWS for resilience and scale
Shopify
Runs a large, deliberately modular ('majestic') monolith
Segment
Famously moved from microservices back to a monolith

Interview Questions

Why is 'start with microservices' often considered an anti-pattern for a new product?

Early on, domain boundaries are unclear and changes cut across services; premature splitting locks in wrong boundaries and adds distributed-systems overhead before you have the scale or team size to benefit. A modular monolith lets boundaries emerge, then be extracted.

How do you handle a transaction that spans multiple microservices?

You cannot use a single ACID transaction across separate databases, so you use the saga pattern: a sequence of local transactions with compensating actions to undo prior steps on failure, accepting eventual consistency and often coordinating via events.

60-Second Revision
  • →Monolith = one deployable, shared DB, simple and fast to start.
  • →Microservices = independent services with their own data over the network.
  • →Microservices scale teams and hot paths but add distributed complexity.
  • →Cross-service transactions need sagas and eventual consistency.
  • →Start monolith (ideally modular); extract services as scale demands.

Related

Everything on Archprimer is connected — follow the graph.