Skip to content
envexa

Product Engineering

Why most MVPs should start as a modular monolith

Microservices solve scaling problems most MVPs do not have yet. How to structure a modular monolith that is fast to build now and splittable later.

By Envexa Engineering6 min read

When founders ask for a technical architecture for their MVP, the instinct, often from conference talks about companies at enormous scale, is to reach for microservices. For an early product this usually trades a problem you do not have (scaling independent teams) for problems you will definitely have: distributed debugging, network failures, version coordination and operational overhead.

What an MVP is optimising for

An MVP exists to learn quickly whether something is worth building. The architecture should therefore maximise the speed of change and minimise the cost of being wrong. A single deployable application with one database is the simplest thing that supports that: one repository, one deployment, transactions that span features, and local development that is a single command.

Modular, not tangled

A monolith becomes a liability when everything can reach into everything. The remedy is not distribution; it is boundaries inside the codebase.

  • Organise code by business capability (billing, accounts, projects), not by technical layer alone.
  • Give each module a small public interface; other modules call that, not its tables or internals.
  • Keep database access inside the owning module. Avoid cross-module joins on internal tables.
  • Communicate across modules through function calls or domain events within the process.
  • Enforce boundaries with lint rules or import restrictions so they do not erode.
src/
  modules/
    accounts/    # users, orgs, roles
      index.ts   # public API of the module
      internal/  # not importable from other modules
    billing/
    projects/
  platform/      # logging, config, db client, queue
  web/           # routes and UI composition

Decisions worth making on day one

  1. Authentication and authorisation model. Roles and tenant scoping are expensive to retrofit.
  2. Data model and migrations. Use versioned migrations from the first commit.
  3. Background work. A simple job queue stops slow work from blocking requests.
  4. Observability. Structured logs and error reporting from the first deployment.
  5. Tests on the critical path. Not everything, but the flows that must not break.

When to split a service out

Extract a module into its own service when a specific, measurable constraint appears: it needs to scale independently (for example CPU-heavy document processing), it has a different runtime requirement (a Python worker beside a TypeScript web app), it has a different release cadence, or a separate team owns it. Because the boundary already exists, the extraction is mostly mechanical.

What this buys

You ship faster, debug with a single stack trace, and keep operational cost low, while retaining the option to distribute later. The aim is not to avoid architecture. It is to spend your complexity budget on the product instead of the plumbing.

MVPArchitectureMonolithSaaS

Building something like this?

We are happy to review your architecture or help you build it.