Service mesh

mTLS, retries/timeouts/circuit breaking, traffic splitting, sidecar vs ambient. What Istio/Linkerd actually buy you — and the honest cost of running one.

About 24 min read3-question knowledge check

The mental model

Imagine every office in a building gets its own personal assistant sitting just outside the door. Nobody talks to anyone directly any more — you hand your message to your assistant, they find the right office, verify the recipient's ID badge, retry if the line is busy, keep a log of the call, and refuse to connect you if policy says you shouldn't be talking to accounting. The offices (your services) didn't change at all. All the network behaviour moved into the assistants.

That's a service mesh. A **data plane** of proxies (Envoy, usually) intercepts every network call in and out of every pod, and a **control plane** (istiod, linkerd-destination) programs those proxies from central config. Your application code makes a plain HTTP call to http://payments:8080 and knows nothing about mTLS, retries, or circuit breaking.

The value proposition is one sentence: it moves cross-cutting network concerns out of every application library and into infrastructure. Before meshes, mTLS was a Java library, retries were a Go library, and tracing headers were a Python library — and none of them agreed, and none existed for the one Node service written in a hurry.

What you actually get:

  • mTLS everywhere, automatically — identity per workload, certificates issued and rotated (Istio defaults to 24h certs), zero application changes. This is the single most common reason meshes get funded.
  • Traffic control — canary by percentage, header-based routing, mirroring live traffic to a new version.
  • Resilience — timeouts, retries with budgets, outlier detection (eject a bad pod from the load-balancing pool).
  • Golden signals for free — every proxy emits request rate, error rate, and latency for every hop, without touching app code.

The honest cost: a mesh is another distributed system to run, upgrade and debug. It adds latency (single-digit milliseconds per hop with sidecars), memory (~50–100 MB per sidecar × every pod), and a new category of 3am confusion where the app is fine and the proxy isn't. Don't adopt one for five services. Adopt one when "which services can talk to which, and are those calls encrypted?" is a question you can't answer.

The full lesson continues with 15 more sections
  • Deep dive
  • Internal architecture
  • Real-world use cases
  • Best practices
  • Common mistakes
  • Performance
  • Security
  • Production troubleshooting
  • Advantages & disadvantages
  • Alternatives
  • Interview expectations
  • Interview questions
  • Facts to remember
  • Cheat sheet
  • Quick revision