Skip to content
DiaGO

Microservices Trade-offs

What splitting a system into services actually buys, what it actually costs, and how to decide honestly.

A microservice architecture splits a system into services that are independently deployable, that each own their data, and that communicate over a network — usually through versioned HTTP APIs (see REST resource design) or asynchronous messages. Every clause in that definition is load-bearing. If two services must always ship together, they are one service with extra steps. If they read each other's tables, neither owns its data. Lose any clause and you keep the costs of distribution while forfeiting the benefits.

What splitting genuinely buys you

Independent deployment cadence. This is the strongest argument, and it is about people, not machines. When forty engineers share one deployable, every release queues behind everyone else's changes, and one team's regression freezes all teams. Separate services give each team its own release train: build, test, deploy, roll back — without a coordination meeting.

Independent scaling of hot paths. In a bookings platform, availability search might see a hundred times the traffic of payment capture. As separate services, you scale search horizontally without provisioning idle payment capacity. In a monolith you scale everything to the level of the hottest path.

Fault isolation — if you design for it. A crashed recommendations service can degrade checkout to "no suggestions" instead of taking checkout down. But this only happens when callers set timeouts and define fallbacks. Isolation is a property you build deliberately, not one the architecture grants for free.

Technology freedom. A sensor-ingestion service can run a different runtime and storage engine than order management. Real, but the weakest of the four — polyglot sprawl carries its own maintenance bill.

What it costs, just as precisely

Every call can fail or time out. The classic fallacies of distributed computing — the network is reliable, latency is zero — become your daily reality. An in-process call has two outcomes: return or throw. A remote call has more:

// In-process: succeed or throw.
// Over the network: succeed, fail, time out,
// or succeed without you ever finding out.
const result = await inventoryClient.reserveStock(orderId, lines, {
  timeoutMs: 800,
  retries: 1, // safe only because reserveStock is idempotent
});

No cross-service transactions. If Orders and Inventory are separate services, no single ACID transaction can span placing the order and reserving stock. You accept eventual consistency and coordinate multi-step workflows with sagas — sequences of local transactions with compensating actions for failure. The mechanics deserve their own page; the point here is that a guarantee your database gave you for free now becomes application code you must design, test, and monitor.

Operational surface. Each service needs its own deploy pipeline, dashboards, alerts, and a versioned contract its consumers can rely on. Distributed tracing replaces the humble stack trace: debugging one user action now means correlating logs across several processes.

Integration testing pain. Unit tests stay cheap, but proving that six independently released services cooperate correctly is genuinely hard — you end up investing in contract tests and staging environments that a monolith never needed.

The hard part is where you cut

Boundaries, not technology, decide whether microservices pay off. Boundaries should follow business capabilities and team ownership — Conway's law observes that your architecture will mirror your communication structure whether you plan it or not, so plan it. Ordering, Fulfillment, and Billing are capabilities a single team can own end to end; each holds its data and exposes a deliberate interface, the same assignment of responsibility to the owner of the information that Information Expert describes within a single process.

Monolith first — a heuristic, not a law

For most products, a well-structured layered monolith is the best starting point: one deployable, real transactions, trivial refactoring while your module boundaries are still wrong — and early on, they are always wrong. Extract a service when a specific pressure demands it: teams blocking each other on deploys, one component with divergent scaling needs, or a hard isolation requirement such as compliance. This is heuristic guidance drawn from industry experience, not a rule; a rare team that knows its domain cold can start distributed.

Signals you need servicesSignals you don't
Multiple teams routinely block each other on one deploy pipelineOne team still holds the whole system in its head
One subsystem needs an order of magnitude more capacity than the restLoad grows uniformly and a single instance profile fits
A component has hard isolation needs — compliance, blast radius, uptime tierYour pain is tangled code, which modules fix far more cheaply
Boundaries are stable and validated by a running systemThe domain model still shifts week to week

Reach for it

  • Several teams need to deploy on independent schedules
  • One part of the system has scaling needs the rest does not share
  • A component requires strict fault or compliance isolation

Avoid it

  • A small team can still reason about the whole system at once
  • Service boundaries are still changing as you learn the domain
  • The plan involves multiple services sharing one database

Mistakes worth naming

Services split by entity. A UserService, OrderService, and ProductService that are CRUD wrappers around tables is a data model scattered across a network. Placing one order then touches all three, so every workflow becomes a distributed transaction. Split by capability (verbs the business performs), not by noun.

Shared databases between services. Two services on one schema get coupling without independence: neither can migrate its tables or change its model without coordinating with the other. Data ownership is the whole point.

Microservices for a three-person team. The dominant benefit is team autonomy. With one team there is no autonomy to buy — only the operational bill to pay.

Practice

Take a library system: catalog, loans, members, and fines. First, propose a split into two or three services along business capabilities. For each boundary, write down: which team owns it, which data it exclusively owns, what the user experiences when it is down, and which workflow (say, checking out a book while a fine is outstanding) loses its transactional guarantee. Then argue the opposite case: sketch the same system as a modular monolith and name the one specific pressure that would justify extracting your first service.