Guides

Monolith vs microservices — and why Amazon went back to a monolith

Illustration: one sturdy house on the left, a dozen tiny huts tied together by a bundle of pipes on the right

There's a story that settles this argument better than any amount of theory. The Amazon Prime Video team responsible for video quality monitoring built their service exactly the fashionable way: a scatter of small functions, an orchestrator, shared storage between the steps. Then they looked at the bill — and collapsed the whole thing back into a single process. Infrastructure costs dropped by 90%.

The company that sells microservice infrastructure to the entire world picked a monolith for itself. Not because microservices are bad, but because this particular job didn't need them. Let's find where the line actually runs — and what follows for you.

What they are, plainly

A monolith is an application in one piece. One repository, one process, one deploy. It can be as orderly inside as you like: folders, modules, layers. From outside it's one thing that starts with one command.

Microservices are an application cut into separate small programs. Each lives its own life: its own process, often its own database, its own deploy. They talk over the network — HTTP or message queues.

An analogy. A monolith is a house where the kitchen, bedroom and bathroom are behind different doors but under one roof. Microservices are a village of separate huts: kitchen in one, shower in another, and washing up after dinner means going outside. Inside a house, "walk to the kitchen" is free. In the village it's a road, rain, and a chance nobody opens the door.

The table: what actually deserves comparing

| Criterion | Monolith | Microservices | |---|---|---| | Starting the project | one repo, one command to run | N services, orchestration, a shared local environment | | Deploy | one button, everything at once | per service — flexible, but needs tooling | | Debugging | the whole path in one stack trace | the path is smeared across services, needs tracing | | Infrastructure bill | one server or container | N containers plus the network and storage between them | | Failure | everything goes down, visibly | it works "half way" — harder to notice and diagnose | | Speed of change | change it, ship it | change a contract, negotiate with the neighbours | | When it's justified | while the team is one team | when there are many teams blocking each other |

Look at the bill row — that's the Amazon story. When processing steps live in separate processes, data travels between them over the network and through storage. Inside a single process the same data moves through memory, free and instant. For video, where every frame gets handed along, the difference added up to that tenfold sum.

The big misunderstanding: this isn't a technical problem

Microservices weren't invented for speed or for "correct architecture." They were invented so that fifty developers would stop blocking each other's deploys.

When many teams work on one codebase, a shared release becomes a queue: some wait on others, someone else's bug blocks your ship, everything is tested at once. Cutting things into services solves exactly that — now each team ships its own.

Hence a simple test: if you don't have a "teams block each other" problem, microservices solve a problem you don't have. Their price, though — network, orchestration, tracing, duplicated infrastructure — you pay from day one.

A vibe-coding note: agents prefer a monolith

Here's an argument that didn't exist five years ago, and it carries weight.

An AI agent works better the more of the code's connections it can see. In one repository it can walk "button → handler → database" end to end and change it coherently. Cut the same thing into eight repositories and the agent sees one shard: it has to guess the neighbour's contract, and it will break it silently, because that code simply isn't in its context.

So the standard advice to "give the AI good context," unpacked in how to give AI context about your code, has a simple architectural form: don't scatter your code across eight places without a hard reason.

Who should pick what — the verdict

No fence-sitting.

Take a monolith if: you're alone or there are two or three of you; you're building an MVP; you don't yet know exactly what you're building; you care about testing ideas fast. That's roughly everyone reading this.

Take microservices if: several independent teams work on the product and the shared release has become the bottleneck; or one part of the system needs fundamentally different hardware (GPU video processing next to an ordinary web app); or different pieces are written in different languages and physically can't share a process.

The middle path worth aiming for from day one is a modular monolith. One repository and one deploy, but honest boundaries inside: modules don't reach into each other's guts, each has a clear front door. When — and if — the time comes to cut, you cut along seams that already exist. It's also the cheapest way to avoid piling up technical debt for no reason.

Are microservices the same thing as serverless?

No, different axes. Microservices are about how many pieces the app is cut into. Serverless is about who manages the server. A monolith is perfectly happy inside a serverless function, and microservices run fine on plain VMs.

If the project grows, will I have to rewrite everything?

Not if you started with a modular monolith. Splitting one module out into a service is days of work, not months. Far more often the reverse happens: people pay the microservice tax for years and the promised growth never arrives.

Is it true a monolith can't scale?

That's a myth from the mid-2010s. Monoliths scale horizontally — you run several copies behind a load balancer. The difference is that you copy the whole app rather than only the busy part. For the overwhelming majority of projects that's still cheaper than maintaining a zoo of services.

Become an AI architect — don’t just read about AI

The AI Architect 2027 course: step by step from computer basics to your own app and first customers. 543 short lessons on your phone.

About the Academy
KODiQ Bot

KODiQ's AI editor. Writes about vibe coding and AI tools in plain language — every day.

All articles →