Speak to an Expert

Engineering

Modular Monolith Over Microservices: A SaaS Architecture Pattern

Most SaaS that adopt microservices regret it within 2 years. A modular monolith is the better default: what it looks like, when it stops working, and how to extract services selectively.

Sep 3, 2026 · 4 min read
Cover reading Modular monolith first, split later, with a four-step panel: one deployable with strict modules, public interfaces and function calls only, watch for pain signals, and extract one module at a time.

The modular monolith vs microservices question decides how fast a young SaaS team can ship for years. The default architecture choice for new SaaS in 2018-2022 was "microservices, because Netflix." Most teams that adopted it discovered the operational overhead crushed them, and the pendulum has swung. This guide is for founders and engineering leads choosing an architecture for a B2B SaaS product: what a modular monolith is, why it is the better default, when it stops working, and how to split off services selectively.

Modular monolith vs microservices at a glance

A modular monolith is a single deployable with well-bounded internal modules and a shared database. Here is how it compares with microservices on the points that matter to a SaaS team.

Aspect

Modular monolith

Microservices

Deploy speed

Faster: one deployable

Slower: many pipelines to coordinate

Debugging

Easier: one process, one stack trace

Harder: calls cross network boundaries

Operational overhead

Lower

Higher: separate CI/CD and observability per service

Iteration speed

Faster

Slower for cross-cutting features

Independent scaling

Limited: the whole unit scales together

Yes, per service

Polyglot freedom

Limited

Yes, each service picks its stack

Team autonomy at scale

Limited

Strong

The modular monolith is the right default for SaaS until roughly 50 engineers, or until extreme scale forces a split.

Why microservices fail for early-stage SaaS

A 6-engineer team building a SaaS does not need 12 microservices. What they get with microservices:

  • 12 CI/CD pipelines

  • 12 deploys to coordinate for a cross-cutting feature

  • 12 sets of observability

  • Distributed transactions that are hard to reason about

  • Each engineer becomes a part-time devops

The operational tax is real. The benefits (independent scaling, team autonomy) are not yet visible at that team size, so the team pays the full cost of distribution and collects none of the return. The same reasoning applies to infrastructure choices; we make a similar case in why multi-cloud is almost always a mistake.

What a modular monolith looks like in practice

A single codebase, deployed as one unit (or two if you split web and worker). Inside the codebase:

  • Clear module boundaries (e.g. billing, users, notifications)

  • Public interfaces between modules (function calls, not HTTP)

  • Modules never directly query each other's database tables

  • Each module has its own tests

The discipline is internal architecture: clean boundaries, no cross-module table access, public APIs only. This is the same discipline microservices enforce, without the operational cost. A sketch of what a module's public surface can look like in TypeScript:

// modules/billing/index.ts: the ONLY file other modules may import
export { createInvoice, getInvoice } from "./service";
export type { Invoice } from "./types";

// modules/notifications/send-receipt.ts
import { getInvoice } from "../billing"; // a function call, not HTTP
// never: import { db } from "../billing/db" or a query on billing's tables

The shared database is still partitioned by ownership: each table belongs to one module, and only that module reads or writes it. If you are designing that database for many customers, our comparison of RLS vs schema-per-tenant on Postgres covers the next decision.

When the monolith stops working

You feel the pain in specific, recognisable ways. Each signal points at a module, not at the whole system.

Signal

What it tells you

One team's deploy blocks others

That module's release cadence has diverged

One module's bug crashes everything

That module needs isolation

One module needs to scale to 10x the others

That module needs independent scaling

Different modules need different tech stacks

That module needs its own runtime

These signals say "extract this module." Not "rewrite as microservices."

How to extract a service selectively

When one module's needs diverge:

  1. Solidify the public interface

  2. Extract that module to its own deployable

  3. Replace function calls with HTTP/gRPC calls

  4. Keep the rest of the monolith intact

Step 1 is where the modular discipline pays off. If every caller already goes through the module's public interface, step 3 is a change at one seam rather than a hunt through the codebase.

You end up with a "small handful" of services (3-7), not 30. This is the realistic end-state for most B2B SaaS. Running that handful does not need a large platform either; see how we keep Kubernetes costs under ₹50K/month for early-stage SaaS.

What we recommend

Start as a modular monolith. Maintain the discipline. Extract selectively when a module's needs justify it.

Common pitfalls

Premature extraction. Extracting before pain is operational debt for no benefit.

A monolith that is not modular. A big ball of mud is worse than microservices. Discipline is the prerequisite.

FAQs

Which languages support a modular monolith?

Modular monolith works in Node, Python, Go, Ruby and Java. All have module boundaries.

How is a modular monolith deployed?

As a single binary or container. Workers run separately but still live in the same repo.

Can a modular monolith run multi-region?

Yes: run multiple regional deploys of the same monolith.

When should a SaaS move to microservices?

Only for the modules that show the pain signals above, and typically not before around 50 engineers or extreme scale. Extract those modules one at a time and keep the rest together.


Planning a new SaaS platform or untangling an existing one? Talk to Techpuvi about SaaS architecture, or read more about how we build complex web applications.

Niranjana serves as a Senior Architect at Techpuvi. She brings more than 15 years of experience in software development, having built several products from the ground up. Choosing to specialize as a full-stack engineer, she maintains a strong commitment to continuous learning.