What Are Microservices? A Clear Definition, Examples and Trade-offs
What are microservices? A plain definition, concrete examples, how services talk to each other and the real trade-offs against a monolith before you commit.
In this article:
- What are microservices?
- The five properties of a real microservice
- Microservices examples
- How microservices communicate
- Microservices vs monolith: the real trade-offs
- When microservices are the wrong answer
- Conclusion
Few terms in software engineering are used as loosely as “microservices”. For some teams it means “we use Docker”, for others “we have more than one repository”, and for a few it is a synonym for modern. None of these is the definition.
This guide answers what are microservices in plain terms, shows concrete microservices examples, and lays out the trade-offs against a monolith honestly, including the costs that conference talks tend to skip.
What are microservices?
Microservices are an architectural style in which an application is built as a set of small services, each responsible for one business capability, each running in its own process, and each deployable on its own. The services cooperate over the network through well-defined APIs or events.
The opposite is a monolith: one codebase, one build, one deployable unit. Everything from user login to invoicing runs in the same process and ships in the same release.
The key word in the definition is not “small”. It is independent. A service that cannot be changed, tested and deployed without coordinating with three other teams is not a microservice, whatever its size. Size is a consequence of good boundaries, not the goal.
A useful one-line test: if you can deploy a change to one service on a Tuesday afternoon without telling anyone outside its team, you have a microservice. If the release needs a shared calendar slot, you probably have a distributed monolith.
The five properties of a real microservice
A microservices architecture is easier to recognise by its properties than by its technology stack. A real microservice:
- Owns one business capability. Payments, catalogue, notifications, pricing. Not “the database layer” or “the API layer”: services cut by technical layer inherit all the coupling of the original system.
- Owns its data. Each service has its own store, and no other service reads or writes its tables directly. Shared databases are the most common way independence quietly disappears.
- Deploys independently. It has its own pipeline and release cadence. A new version can go to production without rebuilding anything else.
- Communicates through contracts. Other services depend on its API or its events, never on its internals. Contracts are versioned and changed with care.
- Is owned by one team. One team builds it, runs it and gets paged for it. This is Conway’s Law used deliberately: the architecture mirrors the organisation.
If one of these is missing, the system can still work well. It just is not getting the benefit microservices are supposed to deliver, while still paying their cost.
Microservices examples
Abstract definitions only go so far. Here is how a typical e-commerce platform might be split.
| Service | Business capability | Owns this data | Why it is a separate service |
|---|---|---|---|
| Catalogue | Products, categories, search | Product records, search index | Read-heavy, scales differently from checkout |
| Cart | Basket contents per session | Carts | Short-lived data, high write volume |
| Checkout | Order placement | Orders | Critical path, changes often during promotions |
| Payments | Charging and refunds | Transactions | Strict security and compliance isolation |
| Inventory | Stock levels and reservations | Stock | Updated by warehouses as well as the shop |
| Notifications | Email, SMS, push | Templates, delivery log | Clear inputs and outputs, minimal shared state |
Notice that each row has a reason beyond “it felt cleaner”. Different scaling profiles, different change rates, different compliance needs and different owners are the legitimate drivers of a service boundary.
A second example comes from our own work. A B2B payment platform ran on an eight-year-old PHP monolith with no tests and more than 40 production incidents a month. We did not split it into dozens of services. We extracted three critical microservices, added CI/CD and reached 85% test coverage on the new modules. Incidents per month fell by 78% and weekly deployments grew fourfold. The full story is in the fintech technical debt case study.
The lesson from both examples is the same: extract where there is a concrete reason, and leave the rest alone until there is one.
How microservices communicate
Once capabilities live in separate processes, every interaction becomes a network call. That single fact explains most of the complexity of a microservices architecture.
Synchronous calls
One service calls another over HTTP/REST or gRPC and waits for the answer. It is simple to reason about and fine for queries such as “what is the price of this product?”. The risk is chains: if checkout calls pricing, which calls inventory, which calls a supplier API, the slowest and least reliable link sets the pace for everyone.
Asynchronous events
A service publishes an event, such as “OrderPlaced”, to a message broker, and any interested service reacts in its own time. Coupling is lower and failures are contained, but data becomes eventually consistent: for a short time, different services can hold different views of the truth.
The supporting infrastructure
Running services in production needs pieces a monolith never required:
- an API gateway to route external traffic to the right service;
- service discovery so services can find each other;
- distributed tracing and centralised logging, so a single request can be followed across ten services;
- resilience patterns such as timeouts, retries and circuit breakers;
- a way to handle transactions across services, usually sagas with compensating actions.
None of this is exotic, but all of it must be built, operated and understood by the team. It is the entry ticket, not an optional extra.
Microservices vs monolith: the real trade-offs
The microservices vs monolith question is rarely about which is better in general. It is about which costs your organisation can afford right now. Here are the microservices advantages and disadvantages side by side.
| Dimension | Monolith | Microservices |
|---|---|---|
| Deployment | One release for everything; simple but coupled | Independent releases per service; needs mature CI/CD |
| Scaling | Scale the whole application | Scale only the hot spots |
| Team autonomy | Teams coordinate on one codebase | Teams own and ship their services |
| Failure isolation | One bug can take down everything | Failures can be contained, if designed for |
| Data consistency | Local transactions, strong consistency | Cross-service consistency is hard; often eventual |
| Debugging | One process, one stack trace | Requests span services; tracing is mandatory |
| Operational cost | Low: one pipeline, one runtime | High: many pipelines, monitoring, on-call |
| Refactoring boundaries | Cheap: move code between modules | Expensive: change contracts and migrate data |
The last row is the one teams underestimate most. Inside a monolith, a wrong boundary costs a refactoring. Between services, it costs an API change, a data migration and coordinated releases.
That is why the best path for many teams is a modular monolith first: one deployable unit with strict internal boundaries. When a module has proven its boundary and has a real reason to leave, it can be extracted with the strangler fig pattern, one capability at a time and with production running throughout.
Microservices do support fast, frequent delivery. The DORA 2021 report found elite performers deploying 973 times more frequently than low performers. But architecture alone does not get a team there: test automation, CI/CD and small batches matter as much. Splitting a system without those practices usually makes delivery slower, not faster.
For a decision framework based on team size and organisational maturity, see microservices vs monolith.
When microservices are the wrong answer
Microservices solve organisational and scaling problems. They do not solve messy code. A tangled monolith split into services becomes a tangled system with network calls in between: the distributed monolith, which has the operational cost of microservices and the coupling of the original.
Before decomposing, check honestly:
- Do parts of the system genuinely need to scale independently?
- Are several teams blocked by coordinating releases on one codebase?
- Are the domain boundaries stable, or is the product still finding its shape?
- Do you have automated tests you trust on the parts you want to extract?
- Is your pipeline able to deploy several times a week without drama?
- Do you have tracing, centralised logging and on-call for multiple services?
- Can each candidate service own its data without sharing tables?
If most answers are “no”, the higher-return investment is usually refactoring the monolith into clear modules and fixing the delivery pipeline. If most are “yes”, our step-by-step monolith to microservices guide covers boundaries, extraction order and data migration.
Conclusion
So, what are microservices? Independently deployable services, each owning one business capability and its data, cooperating through contracts and owned by one team. Their value comes from independence: of deployment, scaling and teams. Their cost comes from distribution: network calls, eventual consistency and a much heavier operational load.
The right question is not “should we be on microservices?” but “which part of our system has a concrete reason to become independent, and can we extract it safely?”. If you are weighing that decision, our monolith to microservices service extracts services incrementally, with zero downtime and reversible steps, and the first 30-minute call is free.