Monolithic vs Distributed Architecture Trade-offs
On this page
Monolith vs distributed architecture: the trade-offs
Most applications start as a monolith: one deployable application holding the UI, business logic and data access, usually with one database. A distributed architecture splits the system into services that are deployed separately, usually own their own data, and talk over the network.
Neither is better in general. The question is which costs you can afford right now.
| Monolith | Distributed services | |
|---|---|---|
| Deployment | One artifact, one step | Many, on independent schedules |
| Scaling | The whole app together | Each service separately |
| Transactions | Ordinary database transactions | Coordination across services (Day 49) |
| Debugging | One process, one log, one stack trace | Tracing a request across services |
| Failure | One bug can take down everything | Failures can be isolated, if you design for it |
| Team fit | Small to medium teams | Many teams owning separate services |
Advantages of a monolith, and the modular monolith
Early on, a monolith is faster to build and change. A feature touching checkout and inventory is one pull request and one database transaction. There's no network between modules, so no timeouts, retries or partial failures inside the app.
A monolith doesn't have to be a tangle. A modular monolith is one deployable with strict boundaries between components. Shopify chose this for its core platform in 2019 instead of microservices, writing that microservices "would bring another whole suite of problems" (Shopify Engineering). In .NET, put each module in its own project, keep its classes internal, expose a small public interface, and enforce the rules with architecture tests such as NetArchTest. Modules with clean boundaries are also the ones you can extract later.
When a monolith starts to hurt
As the system and team grow:
- Scaling is coarse. A monolith scales out fine behind a load balancer (Day 2). But if image processing needs 10 times the CPU, every copy carries it. A cheap first step: deploy the same build twice, one pool serving web traffic and one running background jobs, and scale each pool separately.
- One module's problem is everyone's. A memory leak in recommendations crashes checkout, because they share a process.
- Teams block each other. Fifty developers in one codebase means merge conflicts and coordinated releases.
Worked example: extracting a recommendations service
An e-commerce monolith has catalog, cart, checkout and a recommendation engine. Two years in, recommendations use heavy CPU, deploy weekly with model changes, and occasionally slow the whole process. That's a clear signal for that one module: it needs different scaling, a different release pace, and isolation.
Move it to its own service, called over HTTP with a strict timeout and a fallback: if recommendations don't answer in 100 ms, show a generic "popular items" list. Leave catalog, cart and checkout in the monolith. They share data and transactions, and splitting them buys nothing yet.
Then decide where its data comes from, which is the part teams skip. If the new service reads the monolith's order tables directly, you've split the code but not the system: a schema change in the monolith can break recommendations, and its heavy queries still load the main database. Give it its own store, fed by events or a periodic export of the orders and views it needs (Day 58).
What a distributed architecture costs you
The moment you split, you need things a monolith never needed:
- a way for services to find each other (Day 54),
- timeouts, retries and circuit breakers so one slow service doesn't stall the rest (Days 56, 74 and 75),
- distributed tracing to follow one request across services (Day 88),
- a plan for consistency without a single database transaction.
That's real work and real operational cost. Pay it when the monolith's pain is real, not in anticipation. The worst outcome is a distributed monolith: services that share a database or must be deployed together. You pay every cost of distribution and get none of the independence (Day 51).
Check yourself
Usually no. They'd pay the full operational cost of a distributed system with none of the benefits, which come from independent teams and scaling needs they don't have yet.
Deploy the same build as a separate worker pool that runs only export jobs, and scale that pool on its own. Same code, separate resources.
A network call can be slow or fail. Without a timeout and fallback, a recommendations problem would still slow or break every product page, losing the isolation the split was for.
The two are coupled through the schema, so a monolith change can break it, and its queries still load the main database. Give it its own copy of the data it needs.
It's a single deployable application divided into modules with clear boundaries, each owning its own data and talking to others through defined interfaces. You keep simple deployment and in-process calls, and if one module later needs to scale or move on its own, the boundary already exists.