Microservices Tutorial 0/47 lessons ~6 min read Lesson 3

    Monolith vs Microservices

    Monolith vs microservices is not a purity contest — it's a trade-off between development simplicity and organizational scale.

    Course progress0%
    Focus
    21 guided sections
    Practice signal
    Examples included
    Career prep
    Interview Q&A included

    Introduction

    Monolith vs microservices is not a purity contest — it's a trade-off between development simplicity and organizational scale. Most successful paths start modular inside one deployable unit.

    The story

    Shopify runs a modular monolith at enormous scale. Netflix microservices at 700+ services. Both are correct for their team size, deployment frequency, and domain clarity. The wrong move is microservices because a blog post said so.

    The business problem

    Teams that skip disciplined Monolith vs Microservices thinking pay in coupling, outages, and failed microservices interviews:

    • Distributed ops: no tracing or health checks — hours to debug one checkout failure.
    • Coupling: shared databases and libraries recreate monolith pain across the network.
    • Deploy blast radius: one bad service deploy takes down unrelated domains.
    • Team boundaries: services aligned to tech layers instead of business capabilities.

    The problem teams faced

    This lesson addresses:

    • When and why Monolith vs Microservices matters in decomposed architectures.
    • How to define service boundaries and contracts under interview time pressure.
    • Trade-offs vs alternatives — what staff engineers articulate in architecture reviews.
    • Production patterns and failure modes in distributed systems.

    Understanding the topic

    Core idea: Monolith vs Microservices in microservices architecture.

    • Problem — distributed ops and coupling this topic addresses.
    • Service design — boundaries, contracts, and data ownership.
    • Trade-offs — sync vs async, consistency, deploy blast radius.
    • Interview — how this appears in decomposition loops.

    Internal architecture

    Monolith vs Microservices — microservices view:

    text
    Monolith (modular)
    ├─ Single deploy · shared DB · simple debug
    └─ Extract when: team boundaries + scale force it
    Microservices
    ├─ Independent deploy · DB-per-service · team autonomy
    └─ Cost: distributed ops · consistency · integration tests

    Visual explanation

    Three diagrams: service architecture, decomposition process, and operational lens:

    Monolith vs Microservices architecture
    Monolith
    Entry point
    vs
    Domain logic
    Microservices
    Async path
    Private DB
    Data ownership
    Service view — name boundaries and data ownership in interviews.
    Monolith vs Microservices in microservices practice
    Bounded context
    Domain boundary
    Service contract
    API + events
    Data ownership
    DB-per-service
    Resilience
    CB · timeout
    Repeat this loop for every microservices decomposition question.
    Resilience & operations
    Coupling risk
    Find first
    Isolate failure
    Bulkhead · CB
    Observe
    Traces · metrics
    Iterate
    Extract next
    Always close with failure isolation and observability at scale.

    Informative example

    Example — Monolith vs Microservices:

    text
    | Factor | Monolith | Microservices |
    | Team size | < 20 engineers OK | Multiple teams |
    | Deploy frequency | Weekly OK | Daily per team |
    | Debug complexity | Single process | Distributed traces |
    | Data transactions | ACID in one DB | Saga / eventual |

    Execution workflow

    1Monolith vs Microservices in microservices practice
    1 / 5

    Identify bounded context

    Domain language and team ownership.

    Conway's law applies.

    Real-world use

    Netflix pioneered microservices at scale with hundreds of services and chaos engineering. Amazon's two-pizza teams and service-oriented architecture shaped modern decomposition. Uber migrated from monolith to domain-aligned services for independent deploys. Spotify uses squad-aligned microservices with internal platform tooling. These journeys inform every pattern in this course.

    Production case study

    Shopify runs a modular monolith at enormous scale. Netflix microservices at 700+ services. Both are correct for their team size, deployment frequency, and domain clarity. The wrong move is microservic…

    • Context: monolith pain or decomposition scenario from this lesson.
    • Decision: service boundary and communication choices explained.
    • Outcome: deploy frequency, incident isolation, or latency impact.

    Trade-offs

    • Pro: team autonomy and isolated failure domains.
    • Con: distributed complexity — tracing, sagas, contract tests.
    • Con: premature decomposition costs more than a modular monolith.

    Decision framework

    • Start modular monolith; extract when bounded context and team force are proven.
    • Database-per-service — integrate via API and events, not shared schema.
    • Document rejected alternatives — ADR or interview closing statement.

    Best practices

    • Align services to business capabilities, not technical layers.
    • Draw sync vs async paths; propagate trace context on every hop.
    • Health checks + readiness gates before traffic shift.

    Anti-patterns to avoid

    • Distributed monolith — shared DB, coupled deploys, synchronous chains everywhere.
    • Nano-services — operational overhead exceeds team benefit.
    • Shared libraries hiding domain coupling between teams.

    Common mistakes

    • Splitting before bounded contexts are clear — endless refactor.
    • Cross-service transactions without saga or idempotency.

    Debugging tips

    • Follow one trace_id through the decomposition diagram.
    • Ask "what couples these services?" for every sync call.

    Optimization strategies

    • Replace sync chains with domain events where latency allows.
    • BFF to aggregate calls — don't make clients orchestrate services.

    Common misconceptions

    • Microservices ≠ always better — monolith wins for small teams and unclear domains.
    • Interviews test decomposition judgment — not memorizing Netflix's service count.

    Advanced interview questions

    Interview Prep

    Practice concise answers, then expand each card for the explanation.

    3 questions
    1IntermediateQuestionHow would you decompose a monolith involving Monolith vs Microservices?+

    Answer

    Identify bounded contexts, assign data ownership per service, choose sync vs async integration, and explain saga or eventual consistency for cross-service workflows.

    Follow-up

    Which service would you extract first and why?
    2IntermediateQuestionWhat breaks if Monolith vs Microservices is wrong?+

    Answer

    Coupling increases — shared deploys, cascading failures, or data inconsistency across services. Name concrete failure modes and mitigations (circuit breaker, outbox, idempotency).

    Follow-up

    How do you detect this in production?
    3AdvancedQuestionSenior trade-off for Monolith vs Microservices?+

    Answer

    Team autonomy vs operational cost; consistency vs availability across services; build vs buy for gateway, mesh, and event backbone. State when you'd keep logic in the monolith.

    Follow-up

    Migration path from current state?

    Summary

    You can explain Monolith vs Microservices in microservices interviews and production RFCs — with bounded contexts, data ownership, and resilience patterns. Teach it back without notes.

    Ready to mark this lesson complete?Track your journey across the entire course.