Monolith vs Modulith vs Microservices

You Didn’t Need Microservices. You Needed Boundaries.

If coupling is your problem, draw boundaries. Keep the network out of it.

Introduction

In 2016, architecture talks explained how to split your monolith.  Thousands of teams migrated to microservices, and many of them ended up in the worst possible place: the operational complexity of a distributed system on top of the very coupling they were trying to escape. A distributed monolith. By 2023, things started to take a change, Amazon Prime Video quietly moved one of its monitoring tools off serverless microservices and back into a monolith, cutting costs by 90%. The internet treated it as a heresy. It wasn’t. The question was never whether microservices work. The real question is for whom.

The Classic Monolith

A monolithic architecture is a system designed, built, and deployed as a single unit. It stayed the default for two decades, and not out of inertia: inside a single process, a transaction is atomic for free (either everything is saved or nothing is), a change that touches half the system fits in one commit that the compiler verifies end to end, and debugging means reading a stack trace. And the operational cost is close to zero.

In practice, the monolith’s main problem has been that it grew tightly coupled. For example, nothing stopped a billing class from calling an inventory class directly, so it did, a thousand times over. Over the years, domains stopped having recognizable boundaries: side effects from any minor change, lost confidence in deployments, and teams constantly stepping on each other. That last one, the organizational one, is what ended up mattering most.

Microservices

Microservices showed up to fix these problems. Each domain moved into its own process, with its own database and its own deployment cycle: what used to be coupled through code was now separated by the network.

What made them viable was the cloud, containers, and orchestrators like Kubernetes, which made spinning up and running dozens of processes cheap. And the promise was a good one: every team deploys whenever it wants, and every component scales to its own load.

The price was paid exactly where the monolith was strong. Writing to two different databases is no longer one operation; it’s two, and the second one can fail on its own. The change that fits in a single commit now spans five repositories, and no compiler warns you about what you broke. The stack trace turns into distributed tracing, and you must set it up before you need it. And all of this must be operated: deployments, monitoring, and networking for every service instead of one.

The problem is that the promise is organizational: it pays off when you have twenty teams stepping on each other. With three, you pay the full price and collect nothing. It was adopted as the default anyway, and many teams ended up with all the complexity of distribution, and the coupling still intact: the distributed monolith mentioned earlier. The worst of both worlds.

The Modular Monolith

A modular monolith is nothing more than a monolith that takes boundaries seriously. One deployment, one process, but the code splits into modules that map to business domains and talk to each other only through explicit public interfaces or domain events. This is not a new idea: it’s Eric Evans’s bounded context from DDD, applied inside a single deployment.

That billing class that imported and used the inventory one no longer compiles: the inventory module exposes three methods, and everything else is private. And the rule does not depend on team discipline. It’s enforced at build time by tools like Spring Modulith. Without that, modularity erodes over time, and you’re back where you started.

In return, you get back what used to be expensive: ordinary transactions, global refactors, one deployment to operate. And you give up real things: you can’t scale a module on its own. A serious failure takes down the whole process, and every team shares a release calendar. If that hurts, microservices were your answer.

And it isn’t a permanent decision. When a module grows to the point of needing its own deployment or its own scaling, pulling it out is a matter of swapping an in-memory call for a network one: the boundary is already drawn. That’s exactly the path that wasn’t available when people split monoliths that had no seams to cut along.

Summary

The industry didn’t get it wrong by adopting microservices. It got it wrong by copying the solution of companies whose problem it didn’t have. The single process was never the problem. Coupling was, and you can fix that without bringing the network into it.

That’s why the question at the start wasn’t rhetorical. Microservices work, and work well, for whoever has the problem they solve: organizational scale, teams blocking each other, components with incompatible resource needs.

So before you split anything, ask yourself a question: is your problem technical, or is it organizational? If it’s within the code, draw the boundaries, make them clear and stay in one process.

☀️
Wednesday
19.4°C
💧
53%
Humedad
🔊
47 dB
Ruido
🫁
443 ppm
CO₂
🌍
1023.7 hPa
Presión

SOLD OUT; we will offer number 52230 again next Christmas—thank you so much for sharing in the excitement!

With the number 52230, the magic and wonder of Christmas bring us together each year at Apipana.io

At Apipana.io, we don’t just work on software; we also like to uphold traditions that bring people together. Each year, we share our luck through a Christmas lottery ticket—number 52230—as a way to celebrate the magic of the holiday season and strengthen the bonds within our community.


Just as in our professional work, we believe that the best projects are those that unite us. May the number 52230 serve as a reminder each Christmas that, at Apipana.io, luck is something we build together as a team!