Introduction to Microservices
The defining characteristics of microservice architecture and the core principles that make it work.
Definition
Microservice architecture structures an application as a collection of small, autonomous services, each built around a business capability, each independently deployable, and each owning its own data.
The word 'micro' misleads people into counting lines of code. Size is not the point — autonomy is. A microservice is 'micro' in its scope of responsibility, not necessarily in its codebase.
Core characteristics
Sam Newman and James Lewis/Martin Fowler converge on a shared set of traits:
- Organized around business capabilities — an Order service, not a 'database layer service'.
- Independently deployable — shipping one service never requires shipping another.
- Decentralized data — each service owns its database; no shared tables.
- Communication over the network — REST, gRPC, or asynchronous messaging.
- Designed for failure — every remote call can fail, and the architecture assumes it.
- Owned by small teams — 'you build it, you run it' (Werner Vogels, Amazon).
The autonomy payoff
Independent deployability is the trait everything else serves. When teams deploy without coordination, release frequency goes from monthly release trains to dozens of deploys per day. Netflix deploys thousands of times daily across hundreds of services.
Autonomy also enables heterogeneity: the search team can use Elasticsearch and Java, the ML team Python, the edge team Node.js — each choosing the right tool without a committee.
The price you pay
Every benefit above is bought with distributed-systems complexity. In a monolith, a function call is reliable and instant; in microservices it becomes a network call that can fail, time out, or return stale data.
- Network latency and partial failure on every inter-service call
- No more cross-service ACID transactions — hello sagas and eventual consistency
- Operational overhead: service discovery, gateways, observability, deployment pipelines per service
- Harder end-to-end testing and debugging across service boundaries
Key takeaways
- Microservices = small autonomous services around business capabilities, independently deployable, each owning its data.
- Autonomy — especially independent deployment — is the defining benefit.
- 'Micro' refers to scope of responsibility, not lines of code.
- Benefits are bought with distributed-systems complexity: partial failure, eventual consistency, heavy ops.
Knowledge check
What is the single most important property of a microservice?
Why do microservices avoid sharing a database?
After splitting into microservices, a team notices checkout now involves 6 network hops and fails when any one service is down. What did they forget?