Explanation

When to choose a modular monolith or microservices

When is it worth extracting a microservice from a modular monolith?

A modular monolith keeps distinct parts of an application in one deployment. Extract a service when there is a concrete need for independent deployment, scaling or ownership, and the proposed boundary can support that independence.

Look for a boundary inside the application

Find the public operations of the candidate module. Check which callers use them, who owns its data and whether callers write directly to its tables. A module that already hides its internal representation gives a team a practical starting point for extraction.

Ask what would change at release time

An extracted service adds a network boundary and another component to operate. Consider a consumer running yesterday’s version when the provider deploys today. Walk through an unavailable provider, a slow reply and a schema change. If both sides always need a coordinated release, the proposed split still needs work.

  • A clear scaling need might be a CPU-intensive job that competes with interactive requests.
  • A clear release need might be an independently owned component waiting on unrelated deployments.
  • An interface used only inside one process can still give teams a valuable design boundary.

Worked example

Deciding whether image processing needs its own service

A catalogue module and image resizer share one application. Measurements show that resizing large uploads delays ordinary catalogue requests. Before splitting them, the team checks that the catalogue can display a pending image and tolerate a delayed result. The public behaviour during that delay becomes a contract both components can verify.

Adapted by Cue April from The Engineering Handbook v1.0.0 by Tenhaw (© 2026 Tenhaw LTD). The examples and pull request checks are Cue April adaptations. Tenhaw on monoliths and microservices · CC BY 4.0

Try it on your pull request

On your own PR, identify a caller that crosses the proposed boundary and check what users see if the response is late.

Try Cue April on your repository

Create an account, connect your repository and review the test plan.