Scrivio Interview library
LeadershipPrincipal7 min read · updated 12 November 2026

Service meshes moved retries, mutual TLS and routing from in-process libraries into sidecar proxies, and newer designs move some of it into node-level or proxyless modes. How should you decide where cross-cutting network concerns live over a decade?

I would decide per concern, not per technology, using three factors: how many languages we run, what our teams can operate, and what our security requirements demand. In-process libraries give low latency and full request context but must be upgraded in every service and every language; sidecar proxies are language-neutral and centrally managed but add per-pod resources, latency and operational complexity; node-level or ambient designs cut the per-pod cost but move failure and security boundaries. Whatever we choose, retries must live in exactly one layer, and application code should not depend on the choice, so we can move again in five years.

Why this question is asked

Where network concerns such as retries, mutual TLS, routing and telemetry live has changed several times in a decade: first libraries like Netflix's Hystrix and Ribbon inside each Java service, then service mesh sidecars like Envoy in every pod, and now node-level and proxyless modes. Organisations that bet hard on one model paid to migrate to the next. Interviewers ask this at the most senior level to see whether we can set a durable decision framework rather than pick a winner. In this answer, we will recap the three models, compare what each costs, look at the retry multiplication trap, and then set the decision criteria and the rule that keeps application code independent.

1A Quick Recap of the Three Models

A cross-cutting network concern is something every service-to-service call needs regardless of business logic: encryption and identity with mutual TLS, where both sides present certificates, retries and timeouts, load balancing and routing such as canary splits, and telemetry such as request metrics and traces.

In the in-process model, a library inside each service handles these, for example Resilience4j for retries and circuit breakers and a TLS-enabled HTTP client. In the sidecar model, a proxy runs next to each service instance, in the same Kubernetes pod, and intercepts all traffic; Istio with Envoy is the best-known example. In node-level or ambient models, a shared proxy per node handles basic concerns like mutual TLS, and optional per-service proxies handle richer routing; Istio's ambient mode works this way. A related option is proxyless, where a library inside the service, such as gRPC with xDS support, receives configuration from the mesh control plane without any proxy.

Step throughWhere the network concern can live
  1. Application codebusiness logic, should not care where the concern lives
  2. In-process libraryretries, timeouts, TLS in the service, full request context
  3. Sidecar proxy per podlanguage-neutral, central policy, extra hop and resources
  4. Node-level proxyshared per node, lower cost, shared failure and trust boundary
  5. Network and platformKubernetes networking, load balancers

5 layers, from the top down. Step through them one at a time.

Each concern can be placed at one of the middle layers; the top layer should stay the same.

2What Each Model Costs

In-process libraries have the lowest latency, because there is no extra hop, and the most context: the library knows which business operation is running, whether it is idempotent, and the deadline of the incoming request. But they are language-specific, so a Java, Go and Python estate needs three libraries with three behaviours, and a security fix means upgrading and redeploying every service, perhaps 300 of them, which takes months.

Sidecars are language-neutral and centrally managed: a platform team can roll out mutual TLS or a new routing rule to every service without any team changing code. The cost is one proxy per pod. With 2,000 pods and a sidecar using, say, 0.1 CPU and 100 MB each, that is 200 CPUs and 200 GB of memory just for proxies, plus an extra hop on each side of every call, typically adding a millisecond or so, and a complex component that the platform team must operate and upgrade.

Node-level designs share one proxy among all pods on a node, which removes most of the per-pod cost. But they change boundaries: a failure of the node proxy affects every service on that node, and the proxy holds identities for many workloads at once, so the security model must account for a shared component rather than one proxy per workload.

Comparing the models
ConcernIn-process librarySidecarNode-level or ambient
LanguagesOne library per languageAnyAny
Upgrade a fixRedeploy every servicePlatform rolloutPlatform rollout
LatencyLowestTwo extra hops per callFewer hops, shared proxy
Resource costIn the servicePer podPer node
Request contextFullHeaders onlyHeaders only
Failure boundaryOne serviceOne podAll pods on a node

3The Retry Multiplication Trap

One rule applies whatever we choose: a retry policy must exist in one layer only. If the Java client retries 3 times and the sidecar also retries 3 times, a failing dependency receives up to 9 attempts for each original request. If the dependency itself calls another service through the same stack, the multiplication compounds at each hop: 9 times 9 is 81. During an outage, this turns a struggling service into a dead one, exactly when it needs relief.

So we decide explicitly where retries live. A good default is to put retries where the most context exists: the application knows whether an operation is idempotent and how much of the request's deadline remains, so many organisations keep retries in-process and configure the mesh with retries disabled or limited to connection failures that never reached the server. Others centralise retries in the mesh and forbid them in libraries. Either is fine; both together is not.

Java
# Mesh side: no retries on application errors for this route (Istio-style VirtualService fragment)
http:
- route:
- destination: { host: inventory }
retries:
attempts: 0 # the Java client owns retries for this dependency
// Application side: the only retry policy, with the context to decide
RetryConfig.custom().maxAttempts(3)
.retryOnException(e -> e instanceof InventoryUnavailable) // idempotent reads only
.build();

Field names vary by mesh and version, so check your version; what matters is that one owner decides and writes it down.

4Deciding by Language Diversity, Skills and Security

Here is the reasoning a senior person uses. With a mostly Java estate and strong library ownership, in-process libraries plus a thin platform for mutual TLS can be the simplest and cheapest option. With many languages, consistent policy is very hard to achieve with libraries, so a mesh earns its cost. Team skills matter as much: a mesh is a distributed system of its own, and running one without people who can debug proxy configuration turns every incident into a mystery. Security requirements can decide on their own: if we must enforce mutual TLS and identity-based authorisation for every call, centrally and auditable, a mesh layer is usually the only practical way.

We also do not have to choose one model for every concern. A common split is mutual TLS and basic telemetry in the platform, at node level or in sidecars, and retries, timeouts and circuit breakers in-process, where the request context lives.

5Keeping Application Code Independent

The rule that protects us over a decade is that application code must not depend on where the concerns live. Services read their timeouts and retry settings from configuration, not from constants. They propagate standard trace context headers, such as W3C traceparent, which every model understands. They call plain host names, not mesh-specific APIs, and they do not parse proxy-specific headers in business logic. Then moving from sidecars to ambient mode, or from libraries to a mesh, is a platform change with configuration updates, not a rewrite of 300 services.

We revisit the decision every couple of years with fresh numbers: proxy resource usage, latency overhead, upgrade lead time for security fixes and incident data. The landscape has changed three times in ten years, and it will change again.

6Follow-up questions

Would you adopt a service mesh for 20 Java services?

Probably not as a first step. With one language and few services, libraries plus platform-level TLS and good observability usually cover the needs at much lower operational cost. I would reconsider when languages multiply, the number of services grows, or central security policy becomes a requirement.

Who owns timeouts in a mesh?

Ideally the calling team, because they know their own deadline, but expressed in one place. If the mesh enforces timeouts, the application's client timeout should be slightly longer, or disabled, so the two do not fight and produce confusing errors.

Does proxyless gRPC solve the problem?

It removes the proxy hop while keeping central configuration, but it brings back the library model's limits: it only works for languages and frameworks with xDS support, and libraries must be upgraded in each service. It is one more option to place on the same trade-off map, not a final answer.

7Conclusion

In this answer, we compared three places for cross-cutting network concerns. In-process libraries are language-specific and must be upgraded in every service but give low latency and full context. Sidecars are language-neutral and centrally managed but add per-pod resources, latency and operational complexity. Node-level or ambient designs reduce per-pod cost but change failure and security boundaries. Retries must live in one layer only, the decision depends on language diversity, team skills and security requirements, and application code should stay independent of the choice.

What to say in the interviewAbout 80 seconds aloud

Open with

I'd frame it as a placement decision per concern, revisited over time, rather than picking a technology. In-process libraries, like Resilience4j in Java, have the lowest latency and full request context, so they know if an operation is idempotent and how much deadline is left, but they're language-specific and a security fix means redeploying every service.

Then, if they want more

Sidecars like Envoy in Istio are language-neutral and let a platform team roll out mutual TLS and routing centrally, but they cost a proxy per pod, which at a couple of thousand pods is hundreds of CPUs and gigabytes of memory, plus extra hops and a complex system to operate.

Node-level or ambient designs reduce that cost but put many workloads behind one shared proxy, which changes the failure and security boundaries. One rule applies regardless: retries live in exactly one layer, because three in the client times three in the proxy is nine attempts per request, compounding at each hop during an outage.

Then I'd decide by language diversity, by what the teams can actually operate, and by security requirements; a common split is TLS and telemetry in the platform and retries and timeouts in-process. And the long-term protection is keeping application code independent: configuration-driven timeouts, standard trace headers, no mesh-specific APIs in business code.

About this answer

Last updated
12 November 2026
Checked
Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the official documentation for the version you use. What the checks cover
Where the question comes from
Written by Scrivio for practice. It is not taken from an interview.
Report an issue with this answer

Copy the line below and send it to the author with what you found. It carries the address of this page.

Issue with "Service meshes moved retries, mutual TLS and routing from in-process libraries into...": https://scrivio-interview-library.netlify.app/java/structural-patterns/fc0cf783ea/