Skip to main content
SDMastery
intermediate11 min readUpdated 2026-05-22

Monolith vs Microservices

When to use a monolithic architecture versus microservices, the real tradeoffs involved, and practical migration strategies used by companies like.

Quick answer: Monolith vs Microservices

Monolith vs Microservices is covered here as a practical system design concept. When to use a monolithic architecture versus microservices, the real tradeoffs involved, and practical migration strategies used by companies like. Use it to understand the Architecture Patterns idea, where it appears in production systems, and how to discuss it clearly in interviews.

Focus on the problem being solved, the main design choice, the failure mode, and the tradeoff you would defend in front of a senior engineer. This page is part of the DosiBridge system design knowledge graph, so it links related concepts, interview problems, tradeoffs, and references instead of leaving the topic isolated.

Monolith vs Microservices
Interview preparation checklist for Monolith vs Microservices with key points to mention and mistakes to avoid
Interview tips for Monolith vs Microservices

The Debate That Refuses to Die

System architecture diagram for Monolith vs Microservices showing how services, databases, and caches connect
System architecture for Monolith vs Microservices

Every few years, the industry swings between "microservices are the future" and "monoliths are underrated." The truth, as usual, is that both architectures solve real problems and both have real costs. The choice depends on your team size, operational maturity, and system requirements — not on what Netflix or Uber uses.

A monolith is a single deployable unit that contains all application functionality. A microservices architecture decomposes the application into independently deployable services, each responsible for a specific business capability.

The Monolith

Step-by-step diagram showing how Monolith vs Microservices processes a request from start to finish
How Monolith vs Microservices works step by step

A monolithic application runs as a single process (or a small number of processes). All modules share the same memory space, the same database, and the same deployment pipeline.

Strengths that matter in practice:

Simplicity. One codebase, one build, one deployment. A junior engineer can clone the repo, run it locally, and understand the entire system. There is no service mesh to configure, no distributed tracing to set up, no inter-service authentication to manage.

Performance. Function calls within a process are nanoseconds. Network calls between services are milliseconds. A monolith avoids the latency tax of serialization, network round trips, and deserialization that microservices pay on every internal call.

Transactions. ACID transactions across multiple domain entities are trivial in a monolith — they share a database. In a microservices architecture, achieving the same consistency requires sagas, two-phase commits, or eventual consistency, all of which are significantly more complex.

Debugging. A stack trace in a monolith shows the complete call chain. In microservices, a single user request might touch 10 services, and you need distributed tracing (Jaeger, Zipkin) to reconstruct the flow.

Weaknesses that eventually hurt:

Scaling granularity. You scale the entire monolith even if only one component needs more resources. If your image processing module needs 10x compute but your user profile module does not, you still deploy 10x instances of everything.

Deployment coupling. A one-line change in the payment module requires redeploying the entire application. As the codebase grows and more teams contribute, deployment frequency slows. At Etsy, their monolith deployment took 20+ minutes, which limited how often they could ship.

Technology lock-in. The entire application must use the same language, framework, and runtime. If Python is perfect for your ML recommendation engine but Java is better for your high-throughput order processing, tough luck.

Organizational scaling. When 50+ engineers work on a single codebase, merge conflicts multiply, build times grow, and teams step on each other. Conway's Law kicks in: the architecture reflects the organization, and a monolith requires tight coordination.

Diagram showing the key components and data flow in a Monolith vs Microservices system design
Monolith vs microservices deployment architecture

The Microservices Architecture

Comparison table for Monolith vs Microservices contrasting approaches, tradeoffs, and when to use each
Comparing key metrics for Monolith vs Microservices

Microservices decompose the application along business capability boundaries. Each service owns its data, exposes an API, and can be deployed independently.

Strengths that matter in practice:

Independent deployment. The payments team can ship three times a day without coordinating with the search team. Amazon deploys code every 11.7 seconds on average — this is only possible because each team deploys their own service independently.

Technology flexibility. Each service can use the language, framework, and database best suited to its requirements. Uber uses Go for high-performance services, Python for ML pipelines, and Java for legacy systems. Netflix runs a mix of Java, Python, and Node.js.

Targeted scaling. Scale only the services that need it. During a flash sale, scale the product catalog and checkout services while leaving the account settings service unchanged.

Fault isolation. A memory leak in the recommendation service does not crash the checkout flow. Circuit breakers (Hystrix, resilience4j) prevent failures from cascading across service boundaries.

Weaknesses that will bite you:

Distributed systems complexity. Network failures, partial failures, message ordering, idempotency, distributed transactions, service discovery, load balancing, retries, timeouts, circuit breakers — you are now building a distributed system, and distributed systems are hard.

Data consistency. Each service owns its database, so cross-service queries require API calls or event-driven synchronization. "Show me all orders for this user with product details and shipping status" might require calls to three services. Maintaining consistency across these services requires careful event-driven design.

Operational overhead. Each service needs its own CI/CD pipeline, monitoring, logging, alerting, and on-call rotation. With 100 services, you need 100 pipelines, and observability becomes a first-class concern. Companies like Netflix and Uber employ dedicated platform teams just to manage the microservices infrastructure.

Testing complexity. Integration testing requires spinning up multiple services with their dependencies. End-to-end tests are brittle because they depend on the state of many services. Contract testing (Pact) helps but adds its own overhead.

When to Choose What

Data flow diagram for Monolith vs Microservices showing how requests and responses move through the system
Data flow through Monolith vs Microservices

Start with a monolith if:

  • Your team is smaller than 20 engineers
  • The product requirements are still evolving rapidly
  • You do not have a dedicated platform or DevOps team
  • You prioritize development speed over operational flexibility

Move to microservices if:

  • Multiple teams need to ship independently with different release cycles
  • Different components have drastically different scaling requirements
  • You have the operational maturity to run a distributed system (observability, CI/CD, service mesh)
  • Your monolith has become so large that it slows down development

Shopify runs one of the largest Ruby on Rails monoliths in the world and powers billions of dollars in commerce. They invested heavily in modularizing the monolith (components, clear boundaries, isolated databases) rather than splitting into microservices. Their reasoning: the operational cost of microservices was not justified given their team structure and deployment practices.

Conversely, Amazon famously mandated in 2002 that all teams must expose their functionality through service APIs. This "API Mandate" memo from Jeff Bezos forced a microservices architecture that enabled AWS to exist as a product. But Amazon also had thousands of engineers and the resources to build the tooling to make microservices work.

Migration Strategies

Component diagram for Monolith vs Microservices showing each building block and its responsibility
Key components of Monolith vs Microservices

If you decide to migrate from a monolith to microservices, do not attempt a big-bang rewrite. That approach has a long history of catastrophic failure. Instead:

Strangler Fig pattern. Named after the tropical plant that grows around a host tree and eventually replaces it. Route new functionality to new services while the monolith continues to handle existing functionality. Over time, extract modules from the monolith into services, redirecting traffic at the API gateway level. Each extraction is a small, low-risk operation.

Domain-Driven Design boundaries. Identify bounded contexts in your monolith — areas of the codebase that are cohesive internally but loosely coupled externally. These become natural service boundaries. A bounded context like "Payments" that has clear inputs (charge requests) and outputs (payment confirmations) is a good extraction candidate.

Database-first separation. Before extracting a service, separate its data. Create a new database for the module, set up data synchronization, and update the monolith code to use the new database. Once the data is separated, extracting the code into a service is much simpler.

Decision guide for when to choose Monolith vs Microservices and when alternative approaches are better
When to use Monolith vs Microservices

Branch by abstraction. Introduce an abstraction layer (interface) in front of the module you want to extract. The monolith initially uses a local implementation. When the new service is ready, swap the implementation to an HTTP/gRPC client that calls the service. This allows gradual migration with easy rollback.

The Modular Monolith: The Middle Ground

Tradeoff analysis for Monolith vs Microservices listing advantages, disadvantages, and real-world considerations
Advantages and disadvantages of Monolith vs Microservices

A growing number of teams are choosing a modular monolith: a single deployable unit with strict internal module boundaries, separate databases per module, and well-defined interfaces between modules. You get the simplicity of a monolith with much of the organizational benefit of microservices.

If a module eventually needs to become a separate service (different scaling requirements, different team ownership), the extraction is straightforward because the boundaries are already clean.

This approach is gaining traction at companies like Shopify, Basecamp, and many startups that learned the hard way that microservices introduce more problems than they solve at small scale.

What to Say in an Interview

Production deployment examples of Monolith vs Microservices at companies like Netflix, Google, and Amazon
Real-world examples of Monolith vs Microservices

Never start with microservices. Start with a monolith, explain that it works for the initial scale, and then describe the specific pain points that would drive a migration to microservices. This demonstrates maturity — you understand that architecture decisions are driven by concrete constraints, not industry hype.

Real-World Production Example

When Shopify reached $1 billion in gross merchandise volume, they faced a critical architecture decision. Their Ruby on Rails monolith was enormous — millions of lines of code — and developer productivity was declining. Build times were long, deployments were risky, and teams were stepping on each other. The conventional wisdom in 2018 was clear: decompose into microservices.

Shopify chose a different path. Instead of breaking the monolith into separate services, they modularized it. They created strict component boundaries within the monolith using a system they called "componentization." Each component has a defined public API, its own database tables (enforced by linting rules), and cannot reach into another component's internals. Dependencies between components are explicitly declared and tested. The result is a "modular monolith" — the organizational benefits of service boundaries without the operational cost of a distributed system.

The results validated their approach. Shopify processes over $7 billion per Black Friday Cyber Monday weekend on this modular monolith. Deploy times improved because changes are scoped to components. Teams work independently because component boundaries prevent coupling. And they avoided the operational overhead of service meshes, distributed tracing, and inter-service authentication that microservices would have required. Shopify's story is the strongest counterargument to "you must use microservices at scale" — they proved that a well-structured monolith can power one of the largest commerce platforms in the world.

Original DosiBridge notes for Monolith vs Microservices

This section is written specifically for this page, not copied from a general system-design checklist. The useful way to study Monolith vs Microservices is to connect the concept to a production service where growth exposes the first weak assumption in the original design. That framing changes the design discussion from definitions to operating choices.

What makes this topic distinct

  • Ownership Boundary: For Monolith vs Microservices, decide the ownership boundary before choosing tools; otherwise the design looks clean but fails when monolith changes.
  • Blast Radius: For Monolith vs Microservices, decide the blast radius before choosing tools; otherwise the design looks clean but fails when vs changes.
  • Deployment Path: For Monolith vs Microservices, decide the deployment path before choosing tools; otherwise the design looks clean but fails when microservices changes.
  • Runtime Coupling: For Monolith vs Microservices, decide the runtime coupling before choosing tools; otherwise the design looks clean but fails when monolith changes.
  • Operational Handoff: For Monolith vs Microservices, decide the operational handoff before choosing tools; otherwise the design looks clean but fails when vs changes.

Production review question

If a team adopts Monolith vs Microservices, what observable signal proves it helped instead of only making the architecture diagram more fashionable?

Practical metric to track

Track monolith-microservices health as a named dashboard or review item: combine one user-facing metric, one saturation metric, and one correctness metric. For Monolith vs Microservices, this keeps the discussion grounded in behavior that can be measured after deployment instead of generic advice that sounds good in an interview but never gets verified.