Microservices
Also called microservice architecture.
A way of building an application as many small services, each owning one job and its own data, deployed independently.
Last updated
What it is.
In a microservices design, orders, billing, search and notifications might each be a separate service with its own code, database and release schedule. Services talk over APIs or a message queue. The opposite is a monolith: one codebase deployed as one unit.
The split is about teams as much as code. Microservices let several teams ship without waiting on each other. The price is a distributed system: network calls that fail, data spread across stores and more to monitor.
Why it matters
Microservices can speed up a large organisation and let busy parts scale on their own. For a small team they often slow things down, because every feature crosses service lines and every service needs its own deploys, alerts and on-call. The choice changes cost and delivery speed for years.
In a product build
We start most products as a well-structured monolith with clear modules, and split out a service only when a team, a scaling need or a compliance boundary asks for it. Each split comes with tracing and observability so failures across services can be followed.
Common mistakes.
- 01
Starting with dozens of services on day one for a team of four.
- 02
Sharing one database between services, which keeps them coupled while adding network calls.
- 03
Splitting by technical layer (an API service, a database service) instead of by business area.
Work it out with a tool.
Related terms.
- API gatewayA single entry point that sits in front of a system's APIs and handles routing, auth and limits for every request.
- Event-driven architectureA way of designing software where parts of the system publish events about what happened, and other parts react to them on their own.
- Message queueA buffer that holds messages, such as tasks or events, until a worker is ready to process them, so the sender does not have to wait.
- Container (software)A package that holds an application and everything it needs to run, isolated from other software on the same machine.
- Kubernetes (K8s)An open source platform that runs and manages containers across a group of machines: starting them, restarting them, scaling them and routing traffic to them.