Writing
You don't need Microservices, and you probably never will
Microservices solve an organizational problem: too many teams shipping through one codebase. Most teams don't have that problem, and pay the full technical price anyway. What microservices actually buy you, what they cost, and what I'd use instead.
- Published
- Reading time
- 10 min read

Every developer has heard about microservices at some point. In a blog post, a conference talk, a job description, or from a colleague who just came back from one. The word comes with a picture attached: small independent services, each deployable on its own, each scaling on its own, the way Netflix and Amazon do it. At first sight it looks like the grown-up way to build software, the thing you graduate to once your project gets serious.
The problem is that we've been treating microservices as a technical upgrade, when they were mostly invented to solve a people problem. If you don't have that people problem, you get all of the costs and very few of the benefits.
#Where microservices come from
In 1968, Melvin Conway observed that organizations design systems that mirror their own communication structures. Put four teams on a compiler and you get a four-pass compiler. That observation, now called Conway's Law, is the key to understanding why microservices exist at all.
Picture a company with a few hundred engineers working on one codebase. Every deploy bundles changes from dozens of teams. One broken test blocks everyone. A release train leaves once a week and if you miss it, you wait. Nobody really knows who owns the checkout code, because forty people touched it last quarter. The bottleneck here isn't CPU or memory. It's coordination between humans.
Splitting the system into services owned by individual teams fixes that. Each team gets its own repository, its own pipeline and its own release schedule, and the architecture ends up matching the org chart, on purpose. Amazon's two-pizza teams and Netflix's service ownership model came out of exactly that situation. They had the scale of organization that made the trade worth it. Most of us copied the architecture without having the organization.
#What you actually get
If you list the benefits people usually attribute to microservices, almost all of them are about teams:
- Independent deployment. A team can ship without waiting for anyone else's tests or release window.
- Clear ownership. One team owns one service. When it breaks at 3 a.m., there's no debate about who gets paged.
- Smaller cognitive load. A developer only needs to understand their service and the contracts of its neighbors, not the entire system.
- Technology freedom. The data team can use Python while the core team uses Go, without negotiating a shared stack.
Now apply that list to a team of five. Independent deployment from whom? You already sit together and deploy several times a day. Clear ownership? The same five people own everything. Smaller cognitive load? You now have to understand eight services and the network between them instead of one codebase. Technology freedom? You'll end up maintaining the same stack in eight places, or, worse, three different stacks with five people.
The benefits are real. They just only show up once there are enough teams for them to apply to.
#What it costs
The costs, on the other hand, show up from day one, whatever the size of your team.
The most fundamental one is that function calls become network calls. In a monolith, creating an order and reserving inventory looks something like this:
await db.transaction(async (tx) => {
const order = await orders.create(tx, input)
await inventory.reserve(tx, order.items)
})
Either both happen or neither does. The database guarantees it, and you didn't have to think about it.
Split orders and inventory into two services with their own databases, and the same operation becomes this:
const order = await ordersClient.create(input)
try {
await inventoryClient.reserve(order.id, order.items)
} catch (error) {
// Did inventory never get the request, or reserve and then time out?
await ordersClient.cancel(order.id)
throw error
}
This looks only slightly longer, but it's a completely different problem. If the reserve call times out, you don't know whether the reservation happened. If the cancel call fails, you have an order with no stock behind it. Retrying safely requires idempotency keys. Making it reliable means an outbox table, a message broker, and eventually a saga with compensating actions for every step. All of that to get back the guarantee a single BEGIN ... COMMIT gave you for free.
The rest of the bill is less dramatic but adds up:
- Latency and partial failure. Every hop adds milliseconds and a new way to fail. A page that needs data from five services is only as available as the least reliable of them.
- Debugging. A bug that used to be one stack trace is now a request spread across several services and log streams. You'll need distributed tracing and centralized logging before you can investigate anything properly.
- Contracts. Changing a function signature in a monolith is a refactor your IDE does for you. Changing an API between services means versioning, backward compatibility, and coordinating deploys, which is exactly the coordination microservices were supposed to remove.
- Local development. Running the system on your laptop now means a Docker Compose file with a dozen containers, or giving up and testing against a shared staging environment.
- Infrastructure. Service discovery, a gateway, per-service CI/CD, secrets, monitoring and alerting for every one of them. Someone has to own all of that, and on a small team, that someone is also writing features.
Martin Fowler calls this the microservice premium (opens in a new tab): a fixed cost you pay before getting any benefit, which only makes sense once a system is complex enough to justify it.
#The distributed monolith
The worst outcome isn't a team that adopts microservices and struggles. It's a team that adopts them and doesn't notice they've built something worse than what they had.
It usually starts with splitting along the wrong lines. One service per database table, or one service per technical layer: a users service, an orders service, a notifications service that every other service calls synchronously. Then you find out that adding a field to an order means changing three services and deploying them in a specific order. Two services share a database "temporarily". A change in one breaks the others in production, because the contract was never written down.
That's a distributed monolith. You have the coupling of a monolith with the operational cost of microservices, and none of the independence that was supposed to justify it. You can't deploy services independently, so you've lost the main benefit. And you can't call functions directly anymore, so you've also lost the main advantage of the monolith.
Good service boundaries come from understanding the domain, the same bounded contexts I wrote about in Be careful when adopting Domain-Driven Design. Early in a project, you usually don't understand the domain well enough to draw them. Drawing them as network boundaries makes every wrong guess very expensive to fix.
#"But we need to scale"
This is the argument I hear most often, and it's usually the weakest one.
A monolith scales horizontally just fine. Put it behind a load balancer and run ten instances instead of one. Stateless application servers are the easy part of scaling. What actually falls over first is almost always the database, and splitting your code into services doesn't make that go away. It just spreads the same load across several databases that now need to stay in sync.
There are real cases where one part of a system has very different scaling needs from the rest: a video transcoding pipeline next to a CRUD API, or a CPU-heavy report generator next to a latency-sensitive checkout. Extracting that one component into its own service is a perfectly reasonable decision. It's also a very different decision from splitting your whole system into thirty services on day one.
And the industry has been walking some of this back. Segment wrote about moving from over a hundred microservices back to a monolith (opens in a new tab) because the operational overhead was crushing a small team. Amazon's Prime Video team published a case study about consolidating a distributed monitoring service into a single process and cutting its infrastructure cost by around 90%. Shopify runs one of the largest Rails monoliths in the world and invested in making it modular instead of splitting it up.
#A modular monolith gets you most of the way
What most teams actually want from microservices is boundaries: code that's organized by business capability, where one area can't reach into another's internals. You can have that without a network in between.
A modular monolith is one deployable application split into modules, each with a public interface and private internals:
src/
modules/
orders/
index.ts # the only thing other modules may import
internal/
inventory/
index.ts
internal/
billing/
index.ts
internal/
The important part is enforcing it, because a convention nobody checks erodes within a few months. A lint rule is often enough:
// eslint.config.js
export default [
{
files: ['src/modules/**'],
rules: {
'no-restricted-imports': ['error', {
patterns: [{
group: ['**/modules/*/internal/**'],
message: "Import other modules through their index.ts, not their internals.",
}],
}],
},
},
]
Each module can own its own tables, and you can forbid queries across them the same way. Calls between modules are still plain function calls, transactions still work, and moving a boundary that turned out to be wrong is a refactor, not a migration.
And if the day comes when a module genuinely needs to become a service, because a separate team now owns it or it needs to scale differently, the work is mostly done. The interface already exists. You replace the in-process implementation with a client, and you do it for one module, with real evidence that it's worth it. That's Fowler's MonolithFirst (opens in a new tab) argument, and I think it's the right default.
Modules only stay independent if you treat their boundaries seriously. If every module reads every other module's tables "just this once", you end up with a big ball of mud that happens to have nice folder names. The lint rules and the ownership of tables are what make it modular.
#When microservices are actually worth it
None of this means microservices are wrong. They're a tool for a specific situation, and some signs that you're in it are:
- Several teams are blocked on each other's releases, and the coordination cost is measurable, in waiting time, in merge conflicts, in incidents caused by someone else's change.
- A part of the system has genuinely different runtime needs: a different language, different hardware, or a different scaling profile.
- Regulatory or security requirements demand that some data or processing is isolated from the rest.
- You already have the platform maturity to run them: automated deployments, observability, on-call, and people whose job is to maintain all of that.
If none of these apply, the honest answer is that you don't need microservices yet. For most products, built by most teams, that "yet" never ends, and that's fine.
#Conclusion: solve the problem you have
Microservices are a way of scaling an organization. They let many teams work on one product without stepping on each other, and they charge a steep technical price for it. Companies with hundreds of engineers can afford that price, and for them it's often a bargain.
For everyone else, it's a premium paid for a problem that hasn't arrived. Start with a monolith, give it real module boundaries, and extract a service when a team or a workload actually demands it. You'll ship faster, debug in one place, and keep your transactions. And if you ever do need microservices, you'll split along boundaries you've already tested, instead of boundaries you guessed on day one.
- Microservices
- Architecture
- Overengineering