Microservices vs. Monolith: Which Architecture, and When?

Last updated: July 2026

A monolith is a single deployable application; microservices split it into small, independently deployed services that talk over APIs. The debate sounds architectural but is mostly organizational: the real question is whether your team structure, domain knowledge, and operational maturity can pay for the split — because the split always charges.

Key takeaways

QuestionAnswer
MonolithOne codebase, one deploy, in-process calls, one database
MicroservicesMany services, independent deploys, network calls, database per service
The hidden third optionThe modular monolith — one deployable, enforced internal boundaries
Consensus defaultStart monolithic; split when deploy coordination hurts, not before
The trapThe distributed monolith — microservice costs with monolith coupling

The difference in one code sample

Inside a monolith, calling another module is a function call — fast, atomic, and it cannot half-fail:

// Monolith: in-process call — one transaction, one failure domain
const receipt = await billing.chargeOrder(order.id);

// Microservices: the same call crosses the network — and now you own
// timeouts, retries, partial failure, and eventual consistency
const res = await fetch('https://billing.internal/charge', {
  method: 'POST',
  body: JSON.stringify({ orderId: order.id }),
  signal: AbortSignal.timeout(3000),   // what if billing is slow?
});
if (!res.ok) await compensateOrder(order.id); // what if it half-succeeded?

Every microservices pain point lives in those last three lines. The managed middle path keeps custom logic independently deployable without handing you the failure handling — a function is called like a service but runs on platform-managed infrastructure:

// JavaScript / Node.js — Back4app JS SDK
// One deployable unit of business logic, no service mesh required
const receipt = await Parse.Cloud.run('chargeOrder', { orderId: 'ord_481' });
console.log(`Charged: ${receipt.status}`);

Three shapes, not two

Monolith, modular monolith, and microservicesA monolith is one application with intertwined code; a modular monolith is one deployable with enforced internal module boundaries; microservices are separate deployables communicating over a network.

Microservices

network

network

Service A

Service B

Service C

Modular monolith

One deployable
strict module boundaries

Monolith

One app
modules intertwined

A monolith is one application with intertwined code; a modular monolith is one deployable with enforced internal module boundaries; microservices are separate deployables communicating over a network.

The canonical microservices article describes the destination; MonolithFirst describes the road: almost every successful microservices system started as a monolith that got too big, and the modular monolith is how you keep the option open — boundaries first, network later, and only where earned.

Microservices vs. monolith: the practical differences

DimensionMonolithMicroservices
DeploymentOne unit, one release trainIndependent, per service
ScalingWhole app scales togetherPer service, where load actually is
Calls between partsIn-process, nanosecondsNetwork, milliseconds + failure modes
Data consistencyACID transactionsSagas and eventual consistency
Fault isolationOne bug can take everything downFailures contained — if designed for
Where complexity livesIn the codeIn the operations
Team fitOne team, up to ~10 devsMultiple autonomous teams
DebuggingOne stack traceDistributed tracing across services
Cost profileOne runtime, cheapPer-service infra + observability + platform team

The sharpest line in that table is where complexity lives: splitting a system doesn’t remove complexity — it relocates it from the codebase into the network, the deploy pipeline, and the 3 a.m. dashboard.

Both directions of the migration story

The famous direction: a major video-streaming platform spent years splitting its monolith into over a thousand services, solving a scaling problem it genuinely had. The counter-direction is newer and just as instructive: the same industry produced a monitoring service that merged its serverless microservices back into a single process and cut infrastructure costs by roughly 90% — moving data between the pieces was the dominant expense — and engineering teams that consolidated a hundred-plus services back into one, citing test suites and dependency management that had become unmanageable. Both directions were rational: the constant is that the architecture followed the measured problem, not the trend.

Common use cases

  • Monolith: new products, small teams, unclear domains — anywhere learning speed beats scaling theory.
  • Modular monolith: growing products that want future options without present overhead; the default worth defending.
  • Microservices: many teams shipping independently, components with divergent scaling (feed vs. checkout), organizations that already run rapid provisioning, monitoring, and on-call.
  • Hybrid with a managed backend: standard features (auth, data, storage) consumed as a service, custom logic as independently deployed functions — services-grade autonomy at monolith-grade ops cost.

Should you split? A decision matrix

Stay monolithic when…Split when…
The team fits in one room (< ~10 devs)15–20+ devs across multiple teams queue on one release
Domain boundaries still shift monthlyBoundaries have been stable for quarters
Transactions span your core workflowsComponents have genuinely independent data
Ops maturity = “we deploy sometimes”Provisioning, tracing, and on-call are already solid
The pain is code qualityThe pain is deploy coordination

If the left column describes you but the right column tempts you, the modular monolith is the honest compromise — and if you split and find every change touches three services, you’ve built the distributed monolith and should merge back without shame.

Limitations and trade-offs

  • Monolith: the release train slows as teams multiply; one memory leak is everyone’s outage; long-lived tangles resist extraction if module discipline lapses.
  • Microservices: the “MicroservicePremium” — distributed transactions, network failure handling, versioned APIs between your own teams, and an observability stack that becomes its own budget line.
  • Both: neither fixes a badly modeled domain. Service boundaries drawn on a bad model produce a distributed version of the same mess, with latency.
  • The org constraint is real: per Conway’s law, you ship your communication structure. Restructuring the architecture without restructuring the teams reliably produces the anti-pattern.

Where Back4app fits this decision

Back4app is an open-source Backend-as-a-Service (BaaS) platform that combines a managed database, auto-generated REST and GraphQL APIs, authentication, file storage, and Cloud Code serverless functions. It shifts the debate’s terms: the standard 80% of the backend isn’t yours to architect at all, and the custom 20% runs as Cloud Code functions — each independently deployable like a microservice, none carrying a service mesh, a database-per-service, or an ops rotation. Teams that outgrow even that keep the exit: the stack is open source, so extracting a true service later starts from working boundaries, not from a rewrite.

Frequently asked questions

Which is better, microservices or a monolith?

Neither, universally — they optimize different things. A monolith optimizes simplicity: one codebase, one deploy, in-process calls, real database transactions. Microservices optimize team autonomy and independent scaling — at the price of distributed-system complexity. The deciding inputs are team size, domain stability, and operational maturity, not architectural fashion.

Should a startup use microservices?

The strong industry consensus is no — start with a monolith. The canonical argument, from Martin Fowler's MonolithFirst essay, observes that almost every successful microservices story began as a monolith that grew too big, while systems built as microservices from scratch struggle: you end up drawing service boundaries before you understand the domain, which is precisely when you will draw them wrong.

What is a modular monolith?

The deliberately boring third option: one deployable application with strictly enforced internal module boundaries. It keeps the monolith's operational simplicity while building the seams that make a future split possible — and it is the consensus recommended default for most teams, because well-drawn modules can be extracted into services later, while a tangled monolith cannot.

What is a distributed monolith?

The anti-pattern that combines the worst of both worlds: services that are physically separate but must be changed and deployed together — usually because boundaries were drawn wrong or services share a database. You pay microservices operational costs (network calls, orchestration, observability) while keeping monolith coupling. It is the most common failure mode of premature splitting.

When should you split a monolith into microservices?

When deploy coordination — not code size — becomes the bottleneck: multiple teams queueing on one release train, components with genuinely divergent scaling needs, and domain boundaries that have stopped shifting. Practical thresholds from industry experience: below roughly ten developers a monolith is almost always right; splitting starts paying for itself at fifteen-plus developers across several teams.

How do microservices handle data consistency?

With difficulty — this is the most under-advertised cost. Each service owns its database, so the ACID transaction that was one line in a monolith becomes a saga: a sequence of local transactions with compensating rollbacks, settling into eventual consistency. Workflows that genuinely need atomic updates across services are a signal those services should not have been separated.

What does Conway's law have to do with this choice?

Everything — systems end up mirroring the communication structure of the organizations that build them. Microservices work when small autonomous teams each own a service end to end; the architecture is as much an org chart as a diagram. A single small team adopting microservices gains the coordination overhead of many teams without having them.

Have companies moved back from microservices to monoliths?

Yes, and the case studies are instructive. A major video platform's monitoring team famously merged its serverless microservices back into one process and cut infrastructure costs by about 90% — the data passing between the pieces was the dominant expense. Other engineering teams have consolidated hundreds of microservices back into one service citing test and dependency overload. The lesson is not "microservices are wrong" but that the split must pay for its own overhead.

Related terms

Compare with

Further reading

Ready to build your backend?

Start your project on Back4app in minutes — database, auth, APIs, and Cloud Code included. No credit card required.

Written and reviewed by Back4app Engineering, Back4app Engineering · Published 2026-07-24