Monolith or microservices for a team of two to five

Why a small team should start with a modular monolith: what microservices cost in deploys, testing and debugging, and the few signs that justify splitting.

The short answer

A team of two to five should build a modular monolith: one deployable application with clear internal modules, one database and background workers running the same code. Microservices add network failures, many deployments and distributed debugging that a small team pays for every day. Split a service out only for a concrete reason, such as a different scaling profile, a different runtime or a separate team.

On this page
  1. What are the two options?
  2. What do microservices cost a small team?
  3. What does a monolith give you?
  4. How do you keep a monolith from becoming a mess?
  5. When is it right to split a service out?
  6. What if investors or hires expect microservices?
  7. What should you measure?
  8. What does a modular monolith look like on day one?
  9. Working with us

Microservices are popular in conference talks and architecture diagrams. They solve a real problem: many teams that need to work and deploy independently on a huge system. A small team does not have that problem. It has the opposite one: too few people to run a distributed system.

What are the two options?

  • Monolith: one application, deployed as one unit. Its code can still be well organized.
  • Microservices: many small services, each with its own code, deployment, and often its own database, talking over the network.

Between them sits the option we recommend for small teams: a modular monolith. One codebase and one deploy, with the code split into modules that have clear boundaries and talk through defined interfaces.

What do microservices cost a small team?

Each of these is work that a monolith does not have:

  1. Network failures. A function call becomes a network call that can time out, fail or return late. You need retries, timeouts and fallbacks everywhere.
  2. Many deploys. Each service needs its own pipeline, versioning, health checks and rollback. With five services, you have five of everything.
  3. Distributed transactions. A change that touched one database transaction now spans services. Keeping data consistent needs patterns (sagas, outboxes) that are hard to get right.
  4. Debugging. A bug may live in the interaction between two services. You need tracing and aggregated logs to see it.
  5. Testing. End-to-end tests need many services running. Contract tests between them are another thing to maintain.
  6. Local development. Every developer must run or fake all the services.
  7. Data duplication and ownership. Each service owns its data, so reports that join across them are painful.
  8. Operational load. More things to monitor, patch, secure and back up.

For a team of three, each of those competes with building the product.

What does a monolith give you?

  • One deploy, which is easy to make safe. We run zero-downtime deploys of single applications on Docker Compose: how it works.
  • Real transactions. One database means one commit.
  • Simple debugging. One stack trace.
  • Fast refactoring. Moving code across modules is a normal code change, with the type checker on your side.
  • Cheap hosting. One application and one database run comfortably on one server.
  • A clear path to move. The rules that let a monolith run on two servers are few: no state on disk, no important state in memory, scheduled jobs that are safe with two copies. See designing a SaaS that can move servers.

How do you keep a monolith from becoming a mess?

The danger of a monolith is not its size; it is the absence of boundaries. A few habits:

  1. Modules by business area (bookings, billing, notifications), each with its own folder and a small public interface.
  2. A rule that modules do not reach into each other’s tables or internals. Enforce it with lint rules or tests, not good intentions.
  3. Shared code in one place, such as validation schemas and state-machine tables that both the API and the web app import: status columns as state machines.
  4. Background work in a worker that runs the same code as the web process but as a separate process, started from the same image. It can scale and restart separately.
  5. Fast checks in the pipeline: type checking, linting, tests on the real database.
  6. Remove unused code. Dead modules make the boundaries meaningless.

Our own products are built this way: an API, a web app and a worker, from one repository, with one PostgreSQL database each. None of them is split into microservices.

When is it right to split a service out?

Only for a concrete reason you can name:

  • A different scaling profile. A heavy job, such as video processing or document conversion, that needs its own machines or would starve the web app.
  • A different runtime. A component that needs another language or an isolated environment.
  • Isolation for security or compliance. For example, a payment-handling component with a smaller attack surface.
  • A separate team that owns it and wants to deploy on its own schedule.
  • A third-party boundary, where a stable external API is already the contract.

Even then, split one thing at a time and keep the rest.

What if investors or hires expect microservices?

It is a fair question, and the answer is usually that a well-organized monolith is easier to hire for and to keep reliable. Fashion should not decide your architecture. If it helps, describe the plan: modular monolith now, with named conditions for splitting out a service later.

What should you measure?

Pick a few numbers before debating architecture: deploy frequency, how long a change takes from commit to production, how often a deploy causes an incident, and how long it takes a new developer to run the app locally. If these are good, you do not have an architecture problem.

What does a modular monolith look like on day one?

A concrete starting layout for a small team:

  1. One repository with an API, a web app and a worker that share a package of types and validation schemas.
  2. One PostgreSQL database, with migrations that add first and remove later.
  3. One container image per process, built in CI and tagged by commit, so any server can run any version.
  4. A health check on the API and a heartbeat on the worker.
  5. A short written list of the modules and who may call whom.

That is enough structure to keep growing for years, and it keeps the option of pulling one module out when a real reason appears.

Working with us

We design and build SaaS platforms and web applications as modular monoliths with a separate worker, and we will tell you plainly if your case needs more. Describe your product and team through the contact page, or see our SaaS platform work.

Keep reading

Tell us what you want to build.

A product, a website, a search problem or a system that should work better. We reply with a plain answer and the first step.

A few sentences are enough (at least 20 characters).

We use your details only to answer your inquiry. See our privacy policy.