Service Mesh
Move service-to-service concerns like mTLS, retries and traffic splitting out of code and into infrastructure.
Advanced · about 3 hours · difficulty 4/5
Learn first: Microservices and Service-Oriented Architecture, Kubernetes Basics for Backend Developers
In a system with dozens of microservices, every service needs the same plumbing: encrypted connections, retries, timeouts, metrics and gradual rollouts. A service mesh provides this at the infrastructure layer so application code does not have to.
How it works
- A data plane of proxies (usually Envoy sidecars next to each pod, or node-level proxies in newer "ambient" or sidecarless modes) intercepts all traffic between services.
- A control plane (Istio, Linkerd, Consul) configures those proxies from high-level policies.
What you get
- Mutual TLS between services automatically, with identity per service, enabling zero-trust networking.
- Traffic management: retries, timeouts, circuit breaking and traffic splitting for canary releases (send 5 percent to v2).
- Observability: golden metrics (requests, errors, latency) and trace propagation for every call without code changes.
- Authorization policies: "only the checkout service may call the payments service".
The cost
A mesh adds latency per hop, memory per proxy and a significant amount of operational complexity. Debugging now includes the mesh configuration. For a handful of services, a good HTTP client library with timeouts and retries plus a gateway is usually enough.
When it is worth it
Many services owned by many teams on Kubernetes, compliance requirements for encrypted internal traffic, or a platform team ready to own it.
You are ready to move on when you can explain what a sidecar proxy does to a request, and list two problems a mesh solves and two it creates.
Key concepts
- Data plane and control plane
- Sidecar proxies (Envoy)
- Mutual TLS between services
- Traffic splitting and canaries
- Istio vs Linkerd
- Sidecarless and ambient modes
Mini project
Install Linkerd on a local kind cluster with two services, confirm mTLS is active, and run a 90/10 traffic split between two versions.
Check yourself
What does a service mesh give you that a shared HTTP client library cannot?
Free resources
- Istio documentation (Istio)
- Linkerd documentation (Linkerd)
- Envoy proxy documentation (Envoy)