Microservices or monolith: which architecture to choose?
Two opposite ways to structure an application: one deployable unit versus independent services. The modular monolith is often the right middle ground.
Microservices and monolith are two opposite ways to structure an application's code. In a monolith the entire system, interface, business logic and data access, lives in one codebase and ships as a single package: fast initial development, but any significant change means redeploying everything together. In microservices the same application is split into independent services, each with its own database and its own release cycle, deployed on its own schedule and communicating with the others only through network interfaces. Between the two extremes sits the modular monolith: one single deployment, but with hard internal boundaries between modules, each one owning one clear business area. It is not a timid compromise: for most companies it is the architecture that covers the advantages of both extremes best, because it keeps the same boundary discipline without paying the operational cost of an actual distributed system.
See also: Conway's lawConway's law: software mirrors the communication structure of whoever designs it. Two departments that do not talk produce modules that do not talk either.
The modular monolith as the middle ground
A modular monolith organizes code into modules with explicit boundaries and defined internal interfaces, exactly as microservices would, but runs them in a single process and ships them together. The result is that calls between modules stay in-memory function calls instead of network requests, so there is no distributed latency, no partial failures to handle, one place to debug and one deploy pipeline to maintain. Martin Fowler, who in 2014 with James Lewis gave microservices their most-cited definition, warned a year later against the wrong starting point in "MonolithFirst": if domain boundaries are not clear yet, building a distributed system right away just means distributing a model nobody has understood yet. A modular monolith lets those boundaries be refined inside one codebase, and lets a module be extracted as an independent service only when a concrete signal justifies it, not in anticipation.
The operational cost microservices add
The price of microservices is not in the code of any single service, which is usually simpler, but in the whole: they become a distributed system, with every way a distributed system can fail. A network call can arrive late, fail halfway, or duplicate, so every service has to handle timeouts, retries and partial states that simply do not exist in a monolith. It needs an observability layer that is nearly free in a monolith and has to be built on purpose in microservices, distributed tracing, correlated logs across services, dashboards to work out which of ten services involved in one request slowed down. And it needs a critical mass of teams: every independent service needs someone who can release it, monitor it and keep it healthy in production without stopping the others, so the number of services tends to mirror the number of teams, not the other way around. That is Conway's law seen from the cost side: an organization with few teams splitting into twenty microservices produces twenty boundaries nobody really owns, and the coordination microservices promised to remove comes back through the service door as meetings between teams to work out who broke what.
An enterprise example
A manufacturing company with a monolithic order management system notices that the warehouse module comes under load during promotional campaigns, while the rest of the system stays stable: a concrete signal for separation , not a roadmap hunch. The team extracts that module as an independent service, with its own database and its own ability to scale, using the strangler fig pattern to move traffic gradually instead of rewriting everything at once. The rest of the system, billing, customer records, reporting, stays in the monolith: separating it would bring no advantage, only the cost of running more services. The result is not a microservices architecture, it is a monolith with one targeted exception, and that is exactly the kind of decision this comparison should produce.
Why it matters for decision makers
The right question is not "monolith or microservices", but which boundary, if any, is worth the operational cost of truly separating it. Before splitting a system into independent services, count how many teams actually exist, whether they need to release without coordinating, and whether one component carries a systematically different load from the rest. If the answer is no on all three, a well-designed modular monolith costs less, fails more predictably, and evolves faster than a network of distributed services built for an organization that does not exist yet.
Related terms
- Conway's lawConway's law: software mirrors the communication structure of whoever designs it. Two departments that do not talk produce modules that do not talk either.
- DockerDocker packages an application with its libraries, settings and supporting program versions into a container that starts the same way on any computer or server.
- Bounded contextA bounded context defines where a model of the business and its shared language have a consistent meaning and makes that model’s ties to others explicit.
- Service meshAn infrastructure layer that handles routing, encryption and retries between microservices, outside application code.
- Occam's razorAmong equally adequate explanations, Occam's razor favors the one with the fewest unnecessary assumptions, but it never treats simplicity as proof of truth.
If it reminds you of a system nobody dares touch anymore, that is what I put back in order.
See Software Rescue