Video in progress
How do you decide between doing resilience and mTLS at the library level (Resilience4j, Spring) and a service mesh (Istio, Linkerd)?
If all services are Java/Spring and there are dozens of them, libraries are enough and simpler. If you have a multi-language environment, hundreds of services, mandatory mTLS and a centralized traffic policy, a mesh is useful, but it is a complex system in its own right.
📖 Answer
A mesh puts a proxy next to every pod (a sidecar, or in ambient mode a node-level component). Retry, timeout, mTLS, traffic splitting and metrics work without touching the application code.
When a mesh pays off:
- services in Java, Go, Node, Python: configuring the same resilience library the same way in every language is practically impossible;
- a security requirement: all internal traffic over mTLS, certificates rotating automatically, and the "who can call whom" policy kept in one place;
- canary and traffic shifting done by the platform, without changing the applications;
- unified telemetry: each service doesn't write its own metrics.
But the cost is serious:
- an extra hop for every request and a few ms of latency, and memory/CPU per pod;
- upgrading and debugging the control plane is a separate skill; the question "where did the request get lost" now means reading proxy logs too;
- retries at two layers: if both the application and the mesh retry, the load grows (a retry storm). You have to define clearly which layer is responsible.
How I decide: first I write the problem down precisely. "We need mTLS, the auditor requires it" is a strong reason. "We want to add a circuit breaker" is a day of work with Resilience4j, not a mesh.
If a mesh is chosen, the boundary with the application should be clear: network-level timeouts and mTLS go in the mesh; things with business semantics (fallbacks, idempotency, which errors get retried) go in the application, because the mesh doesn't know the answer to "is it safe to resend this POST?".
Another option: start with the mesh only for mTLS and observability, with retries turned off. Introducing it in stages reduces the risk.
Sign up to mark studied questions and save your progress.