✏️ Explanatory Question

What is the difference between a monolith and microservices, and when would you choose each?

👁 9 Views
📘 Detailed Answer
🟢 Easy
No previous question
No next question
💡

Answer with Explanation

Monolith - one deployable unit.

  • Simple to develop, test and debug; one stack trace covers the request.
  • In-process calls, so no network latency or partial failure between modules.
  • Easy transactions across the whole data model.
  • But: any change redeploys everything, and you must scale the entire app even if only one endpoint is hot.

Microservices - independently deployable services, each owning its data.

  • Independent deploys and independent scaling of hot components.
  • Teams own services and can choose their own stack.
  • Failure can be isolated with bulkheads and circuit breakers.
  • But: network calls everywhere, distributed transactions become sagas, debugging needs distributed tracing, and operational overhead is far higher.

Choose monolith for a small team, an unclear domain, or an early product. Choose microservices when specific components have very different scaling profiles, when team coordination on deploys has become the bottleneck, or when fault isolation is genuinely required.

The safe answer: start with a well-modularised monolith and extract services where a real boundary proves itself. Splitting too early locks in the wrong boundaries.

No previous question
No next question