Microservices are a way to break a large system into many small services, each of which lives its own life: separate deployment, separate database, its own part of the business. The style grew as a response to large monoliths that become hard to change as the code and the number of teams grow.
Key characteristics
| Characteristic | What it means in practice |
|---|---|
| Independent deployment | a service is released and rolled back on its own: a change to one service does not require a system-wide release |
| Own database | a service owns its data, and neighbours access it through its API rather than reading other services’ tables |
| Business boundary | a service is responsible for one part of the business — the catalogue, payments, delivery — and can sensibly be replaced as a whole |
| Simple channels | the logic lives in the services themselves, and a simple transport connects them: HTTP or a message queue |
| Designed for failure | services communicate over a network that can fail, so each one survives the crashes and slowness of its neighbours |
Origin of the term
The word microservice was discussed at a meeting of architects near Venice in May 2011, the same group chose the name microservices in May 2012, and the style became widely known after James Lewis and Martin Fowler’s 2014 article. The authors were not describing a plan for the future but an approach that large companies were already using by then.
The cost of the approach
In exchange for independence, the system becomes distributed, and that means the inherent complexity of distributed computing. A system of ten services is ten databases and ten release pipelines instead of one; a request travels over the network, where delays and failures are possible, and a single transaction cannot span several services, so data converges eventually. There is also more observability work: logs, metrics and traces have to be collected across all services at once.
So before splitting a system into services, teams usually check that they are ready:
- the team can work with release automation and operations; without this, services quickly turn into a distributed monolith;
- clear service boundaries have been chosen — usually along the bounded contexts of the domain;
- it is clear how services will find each other and how a client will reach a set of services — usually through an API gateway.
Sources
the term is written from these pagesVerified 8 Nov