Skip to content
Beytullah Toprak

Blog

Monolith vs Microservices: How to Make the Right Architecture Call

How monoliths and microservices differ, why most projects should start with a monolith, the modular monolith and signs it's time to split.

Reading time
6 min read
Monolith vs microservices illustration with database and cloud icons facing each other and a fork arrow
On this page
  1. What Are a Monolith and Microservices?
  2. Monolith vs Microservices: A Comparison
  3. Why Should Most Projects Start With a Monolith?
  4. The Challenges of Microservices
  5. The Middle Ground: The Modular Monolith
  6. Keeping a Monolith Healthy
  7. When Should You Move to Microservices?
  8. SaaS and AI Projects
  9. Frequently Asked Questions
  10. Aren't microservices more modern?
  11. Doesn't a monolith become unmanageable as it grows?
  12. How hard is it to move from a monolith to microservices?

The short answer to monolith vs microservices: for a new product or a small-to-medium team, starting with a well-structured monolith is usually the better call. Microservices pay off when several teams need to move independently, when parts of the system have very different scaling needs, and when you have the infrastructure and experience to run a distributed system. Team size, product maturity and operating capacity should drive the decision.

What Are a Monolith and Microservices?

A monolith is an architecture where all of an application's functions live in one codebase and deploy as one unit. User management, orders, payments and reporting live inside the same application and usually share one database.

In a microservices architecture, the application is split into small services, each developed and deployed separately. Microsoft's guide to the microservices architecture style (opens in a new tab) defines microservices as small, independent, loosely coupled components that a single small team can write and maintain. According to the guide, each service is managed as a separate codebase, and because services deploy independently, teams can update their service without rebuilding or redeploying the whole application.

Monolith vs Microservices: A Comparison

Monolith Microservices
Speed to start High Low, needs infrastructure setup
Deployment One unit Each service separately
Scaling The whole application Each service as needed
Data Usually one database Each service owns its data
Debugging One process, easier Distributed, needs tracing tools
Team structure One or a few teams Independent teams per service
Operating cost Low High: monitoring, networking, pipelines

Why Should Most Projects Start With a Monolith?

One of the most cited views on this comes from Martin Fowler. Fowler's 2015 "Monolith First" post (opens in a new tab) says almost all the successful microservice stories he'd heard started with a monolith that grew too big and was broken up, while almost all systems built as microservices from scratch ended up in serious trouble. Fowler calls the management overhead of microservices the "microservice premium" and says it slows a team down, making microservices worthwhile only for more complex systems.

In a new product, drawing service boundaries correctly is hard, because it isn't yet clear which parts will change together. A badly drawn boundary means two services that always change together, with heavy traffic between them. That brings together the difficulties of both architectures.

The Challenges of Microservices

Microsoft's guide also lists the challenges of microservices plainly:

  • Development and testing: writing and testing a service that depends on other services takes a different approach than a traditional application. Refactoring across service boundaries gets harder.
  • Network congestion and latency: many small services mean more interservice communication. As dependency chains grow, latency becomes a problem.
  • Data integrity: each service is responsible for its own data, so keeping data consistent across services is harder.
  • Skill set: microservices are highly distributed systems. The guide recommends carefully evaluating whether the team has the skills and experience to run them successfully.

On top of that, each service needs its own deployment pipeline, monitoring, log collection and service-to-service authentication. For a small team, that overhead comes out of time that could go into the product.

The Middle Ground: The Modular Monolith

There's an option between monolith and microservices that often gets overlooked: the modular monolith. The application deploys as one unit but is made of modules with clear boundaries inside. Each module has its own responsibility and a defined interface, and modules don't reach into each other's internals.

Shopify is one well-known example. Shopify's 2019 engineering post (opens in a new tab) describes how they moved one of the largest Ruby on Rails codebases in existence from a monolith to a modular monolith. The approach aims to improve code organization and make dependencies between modules clearer without adding more deployment units. Once module boundaries become clear over time, a module that genuinely needs to be separate can be turned into a microservice.

Keeping a Monolith Healthy

Starting with a monolith shouldn't mean leaving the code messy. A few habits keep a monolith healthy for years and make it possible to split later if needed:

  • Organize code by business area, not technical layer: "orders", "payments", "users".
  • Limit modules' direct access to each other's database tables. Reach a module's data through that module's interface.
  • Enforce dependencies between modules with automated tests or static analysis tools.
  • Move work that should run in the background (sending email, generating reports) to a job queue from the start.
  • Set up monitoring and logging from day one. You can't decide what to split off without seeing which part is slowing down.

When Should You Move to Microservices?

Microservices are worth considering when these signs appear:

  1. Several teams work in the same codebase and wait on each other's deployments.
  2. One part of the application has very different scaling needs from the rest (heavy image processing or search, for example).
  3. A part genuinely needs to run on a different technology.
  4. A failure in one part stopping the whole system has become unacceptable.
  5. The team has the infrastructure (monitoring, automated deployment, container management) and experience to run distributed systems.

Move piece by piece, not all at once. Start by separating the module with the clearest boundary and the biggest benefit. I cover building communication between services with events and queues in the post on event-driven architecture, and the basics of containers and deployment in the post on DevOps for small teams.

SaaS and AI Projects

In SaaS products, multi-tenancy can be built with either a monolith or microservices. Early on, one application and a well-designed data model cover most needs. I explain this in the post on multi-tenant architecture.

The same logic applies when adding AI features: grouping model calls in a separate module inside the application is usually enough. When heavy processing or different scaling is needed, that module can move into its own service. I cover this separately in the post on LLM application architecture.

Frequently Asked Questions

Aren't microservices more modern?

Microservices are a newer approach, but they simply offer a different trade-off. They are valuable in large organizations with many teams. In a small team, the operating overhead can outweigh the benefits.

Doesn't a monolith become unmanageable as it grows?

A poorly structured one does. A monolith with clear module boundaries and controlled dependencies can stay healthy for a long time. The problem usually lies in how the code is organized.

How hard is it to move from a monolith to microservices?

Moving from a modular monolith is much easier, because the boundaries are already drawn. Moving from a tangled monolith without boundaries is a long, risky project. I cover when to rewrite an old system in the post on rewriting legacy software.

To decide on the right architecture for your software, see the SaaS and custom software development service or tell me about your project on the contact page.

Share