Microservices architecture
A microservices architecture pays off when parts of the system must scale on their own, or when separate teams need to ship without waiting for each other. We draw service boundaries around business domains, define the contracts between services and plan how each one is deployed and observed. The same analysis can point the other way: we have merged microservices back into a modular monolith when a team was too small to run them.
Microservices architecture: an overview
Microservices solve an organizational problem as much as a technical one. When several teams share one deployable application, they queue behind each other's releases. Splitting the system lets each team deploy on its own schedule and scale its part on its own. The cost is real: network calls instead of function calls, data spread across databases, partial failures, and operations work for every service.
Good microservices architecture starts by deciding whether you need it, using the criteria described below: team ownership, load, runtime, release cadence and compliance. When several of them apply, services pay for themselves. When none does, one well-structured application is cheaper to build and to run. The answer can change over time, in either direction.
When services are the right call, each one owns its data, exposes a versioned contract and runs in its own container behind a single public entry point. Internal services sit on a private network. Those rules keep a system of many parts debuggable by people who did not write all of them.
What the service covers
Service boundaries
We draw boundaries around business domains and the data each one owns. A boundary that needs a shared table or a cross-service transaction gets redrawn.
API and event contracts
Synchronous APIs and asynchronous events get versioned schemas, with OpenAPI or JSON Schema as the source of truth. Contract tests in CI stop a breaking change before another team sees it.
Deployment and networking
Each service runs in its own Docker container, with the same image in development and production. One gateway faces the internet and internal services stay on a private network.
Observability
Traces, metrics and logs share one correlation ID across services through OpenTelemetry, with Prometheus and Grafana for metrics. A single user action can be followed from the gateway to the last database call.
Monolith decomposition
We extract services from an existing monolith one at a time, behind the existing entry point, while the old path keeps running. Each extraction has its reason written in an ADR.
Service consolidation
When a system has more services than teams to run them, we group the ones that change together and merge them into modules of one application. The internal boundaries stay and the network hops go.
When it is the right call
- 01
Several teams share one codebase and spend more time coordinating releases than shipping.
- 02
One part of the system, such as video transcoding or a pricing engine, needs far more compute than the rest.
- 03
You already run many services, and a single user action now crosses so many of them that nobody can debug it.
- 04
You want to split a monolith and need to know which module to extract first, if any.
What you get
Service boundaries drawn from business domains, with one owner per data set
API and event contracts between services, checked by contract tests
One container per service, one public entry point, internal services on a private network
Migration plan from a monolith to services, or from too many services back to fewer
How we work on it
Step 1
Map domains and teams
We list the business domains, the data each one owns, the teams available and how often each area changes. This map, not the current folder structure, drives the boundaries.
Step 2
Decide what to split
Each candidate boundary is scored against the criteria: team ownership, scaling, runtime, release cadence and compliance. Boundaries that score low stay as modules inside one application.
Step 3
Define contracts
Every boundary that becomes a service gets an API or event contract with a versioning rule. Contract tests run in CI on both the provider and the consumer side.
Step 4
Extract or consolidate
We move one service at a time, in either direction, and run the new path in production next to the old one. Lessons from each move go into an ADR before the next.
Step 5
Operate and review
Each service gets health checks, dashboards, alerts and a named owner. We review periodically whether every service still earns its place.
Criteria for splitting a system into microservices
Independent scaling is the clearest case: a video transcoding worker that needs far more compute than the rest should not force the whole application to scale with it. Team ownership is the second: when separate teams own separate domains, giving each one its own deployable removes the coordination cost of a shared release. A different runtime is the third, for example a Python service running document extraction next to a TypeScript API.
Two further criteria are easy to miss. Release cadence: a billing module that changes rarely and must be audited can live apart from a storefront that ships several times a day. Compliance: payment or health data may need its own database, network rules and access log, and a service boundary makes that isolation explicit. If none of these factors applies, a split adds operational work without removing any, and we say so.
Modular monolith or microservices: the trade-offs
A modular monolith is one application and one deployment, divided into modules that talk only through public interfaces. Each module owns its tables, and other modules read that data through the owner's code. You get clear ownership and local changes without a network in between. Its limits: every module ships in the same release, scales together and runs in the same runtime.
Microservices remove those limits and add others: network latency, retries, version skew between services, distributed tracing and a deployment setup per service. A modular monolith whose boundaries are checked in CI can later have a module extracted with little rework, because its interface and its data are already separate. A set of services with clean contracts can be merged back for the same reason. Clean boundaries keep both moves open, and that matters more than the starting point.
Data ownership and consistency between services
The hardest part of microservices is the data, not the code. Two services that write to the same table are one service with two deployments. We give each data set a single owner, and other services get what they need through the owner's API or through the events it publishes.
This means giving up transactions that span services. An order that reserves stock and charges a card becomes a sequence of steps with a compensating action for each, often called a saga, and the events that drive it are written with the outbox pattern so none is lost. If a workflow truly needs one transaction across two services, that is a strong sign the boundary is in the wrong place.
Methods and tools
- Monoliths and microservices
- Domain-driven design
- Architecture decision records
- C4 model
- pnpm workspaces
- Turborepo
- Nx
- PostgreSQL
- Kafka
How you can work with us
Fixed-scope project
The scope of the first version is written down, split into milestones and priced per milestone. It suits a product or a feature with a clear outline.
Dedicated team
A team works on your product over the long run, with its own planning and release cadence. It suits a product that keeps changing.
Team extension
One or more of our engineers join your team and work with your tools and routines. It suits a company that knows where it is going but lacks people or a specific skill.
Monthly support
A monthly retainer covers maintenance, updates and small changes, with an agreed response time. It suits a product in production that needs upkeep more than new features.
Questions about Microservices architecture
How many microservices should we have?
As many as you have reasons for, and no more than your teams can own, deploy and answer for when they fail. A service without a clear owning team becomes the one nobody wants to touch. The count follows from the criteria, such as scaling, ownership, runtime, release cadence and compliance, rather than from a target number.
Can you move us from a monolith to microservices without a rewrite?
Yes, and we would not do it any other way. We extract one module at a time, starting with the one that has the clearest reason to be separate, and route traffic to the new service behind the existing entry point. The old code path stays until the new one has proven itself in production.
Can you merge microservices back into a monolith?
Yes. We do it when the team running the services is too small for them, or when services always change together and share data. We group those services, merge them into modules of a single application and keep the boundaries inside the code.
What drives the cost of a microservices project?
The number of boundaries to design or move, the state of the existing code and tests, and how much data must be migrated between databases. Extracting one service from a well-structured application is a contained piece of work. Splitting a tangled codebase with shared tables means untangling the data first, which is usually the larger part.
Do microservices require Kubernetes?
No. A small number of containers can run on a managed container service or on private servers with Docker and Nginx in front. Kubernetes earns its complexity when you run many services, or need autoscaling and rolling deployments across machines. We choose the hosting with the same criteria as the architecture and record the choice in an ADR.
How do you test a system made of many services?
Each service has unit and integration tests that run in containers, against a real database where it matters rather than mocks. Contract tests check that a provider still satisfies what its consumers expect, without starting the whole system. A small set of end-to-end tests then runs the critical flows across services in the test environment that every release passes through before production.
In the same service area
Design, build and ship your project
Describe it in three lines. We reply with specific questions and a first take on how to proceed.