Service mesh
A service mesh is an infrastructure layer that manages communication between services. Proxies sit next to every service (or on every node) and handle the network concerns every service has: encrypting traffic with mutual TLS, proving service identity, retries and timeouts, traffic splitting for releases, and recording metrics and traces. A control plane configures all the proxies centrally.
Well-known meshes include Istio (opens in a new tab), Linkerd (opens in a new tab) and Cilium (opens in a new tab) service mesh, plus managed offerings from cloud providers. See also service mesh in the glossary.
Diagram
Section titled “Diagram”- The orders service makes an ordinary call; its proxy intercepts it.
- The proxies establish mutual TLS, proving each service's identity, and apply retries and timeouts.
- The receiving proxy checks that orders is allowed to call payments, then passes the request on.
- The control plane issues certificates and pushes routing and security policy to every proxy; proxies report telemetry.
What a mesh provides
Section titled “What a mesh provides”| Area | Capabilities |
|---|---|
| Security | Mutual TLS between all services, service identity, service-to-service authorization policies |
| Traffic management | Retries, timeouts, circuit breaking, traffic splitting for canary releases, fault injection for testing |
| Observability | Consistent request metrics, distributed traces and access logs for every service, in any language |
The value is consistency: these behaviors are the same for every service, in every language, without each team implementing them.
Data plane models
Section titled “Data plane models”- Sidecar proxies: a proxy (often Envoy (opens in a new tab)) runs alongside each service instance. Full features per workload, at the cost of resources and operational overhead per pod.
- Sidecar-less (node or ambient) models: proxies run per node, with optional per-service proxies only where advanced features are needed. Lower overhead; newer and with different trade-offs.
When it’s worth it
Section titled “When it’s worth it”- Many services, written in several languages, owned by many teams.
- A zero trust requirement for encrypted, authenticated traffic between all services.
- Frequent releases that benefit from traffic splitting and consistent telemetry.
When it isn’t
Section titled “When it isn’t”- A handful of services, or a modular monolith. Libraries, a load balancer and an API gateway cover the needs with much less complexity.
- A team without the capacity to operate and upgrade another distributed system. Consider a managed mesh, or wait.
- Security, resilience and telemetry without code changes.
- Consistent behavior across languages and teams.
- Operational complexity: upgrades, certificate rotation, debugging the proxy layer itself.
- Added latency and resource use per request.
- Retries configured in both the mesh and the application can multiply load. See retries, timeouts and backoff.
Common pitfalls
Section titled “Common pitfalls”- Adopting a mesh for one feature (usually mTLS) and inheriting all of its complexity.
- Duplicated retry policies in code and mesh.
- Assuming the mesh handles authorization fully. It can decide which service may call which; only the service can decide whether this user may see this record.
Related patterns
Section titled “Related patterns”Written and edited by Abhinav Taduka, enterprise software architect.
New pages are added regularly. Follow Abhinav on LinkedIn to see them first.