Scrivio Interview library
LeadershipPrincipal6 min read · updated 12 November 2026

Timeouts, retries and DNS settings are defined differently in every client library and repeatedly cause incidents. Where should this responsibility live in a large organisation: in each service, in shared libraries, or in the platform such as a service mesh?

No single layer should own all of it. Services know their latency needs and which operations are safe to retry, the platform knows the network topology, and shared libraries are the bridge that gives good defaults. A service mesh can enforce timeouts, retries and mTLS uniformly across languages, but shared libraries drift as teams pin old versions, and duplicated retries across layers multiply load. So I would assign each behaviour to exactly one owning layer, write that down, and measure the incidents linked to these settings to justify and steer the investment.

Why this question is asked

At a certain size, every organisation discovers that its incidents rhyme. A timeout that was never set, a retry storm that turned a slow service into a dead one, a DNS cache that outlived a failover. Each incident is fixed locally, and the next one happens somewhere else, because the settings are defined in a dozen libraries in four languages. Interviewers ask this at the principal level to see whether we can design ownership, not just configuration. In this answer, we will look at what each layer knows, the strengths and weaknesses of services, shared libraries and a mesh, the danger of retries in more than one layer, how to assign ownership, and how to measure whether it worked.

1A Quick Recap: What Each Layer Knows

The question is really about knowledge. A service knows things nobody else does: that its checkout call must finish within 2 seconds, that reading a product is safe to retry while charging a card is not, that a report endpoint legitimately takes 20 seconds. The platform knows other things: the load balancer idle timeout, how DNS failover works, where the network boundaries are, how certificates are issued. Shared client libraries sit in between, written by a platform team but running inside the service.

A good design puts each decision where the knowledge is. Business semantics, deadlines and idempotency belong with the service. Topology facts belong with the platform. Defaults that turn platform facts into sensible client behaviour belong in libraries or the mesh.

2Option 1: Each Service Decides

Leaving everything to services gives the most precise settings and the least consistency. Teams that have been burned set timeouts carefully; teams that have not leave the library defaults, which may be infinite. Each team rediscovers the same lessons, and the settings are invisible to anyone looking across the fleet. In a small organisation this is fine. With hundreds of services it is the cause of the repeated incidents in the question.

3Option 2: Shared Client Libraries

A shared library, for Java typically a company Spring Boot starter, sets good defaults for HTTP clients, database pools, DNS and resilience patterns, and adds metrics so every client reports its timeouts, retries and errors the same way. Services get good behaviour by doing nothing, and can override with a reason.

The weakness is drift. A library is a dependency, and teams pin versions. A year later the fleet runs eleven versions of the starter, and the fix for last quarter's incident has reached a third of the services. Libraries also cover one language: the Go and Python services need their own, and the three implementations drift from each other. Libraries remain valuable, but only with active version tracking and automated upgrades.

4Option 3: The Platform, Through a Service Mesh

A service mesh puts a proxy next to every service, and all traffic goes through it. Because the proxy is the same for every language, the platform can enforce timeouts, retries, circuit breaking, load balancing and mutual TLS uniformly, and change them centrally without redeploying any service. It also handles DNS and connection management to the real destinations, which removes a whole class of JVM DNS cache problems.

The costs are real too. A mesh is a complex system to operate, adds a little latency on every hop, and changes how failures look to developers. More importantly, the mesh does not know business semantics. It cannot tell that a POST to /payments must not be retried, or that one endpoint is allowed 20 seconds, unless someone configures that per route, which brings the per-service knowledge back in another form.

5The Hidden Danger: Retries in Several Layers

The strongest argument for clear ownership is retry amplification. Suppose a request passes through three services before reaching a database, and each layer retries failed calls three times. When the database slows down, one user request can become 3 x 3 x 3 = 27 database calls. Add retries in the mesh on top of retries in the application, and the factor doubles again. The retries that were meant to hide brief errors now multiply the load on the component that is already failing, and turn a slowdown into an outage.

One owner per behaviour
BehaviourOwning layerWhy there
Deadlines and per-call timeoutsService, defaults from libraryOnly the service knows its latency budget
Retries and idempotencyService (or mesh per route), not bothRetrying twice multiplies load
Retry budgetLibrary or meshA fleet-wide cap stops storms
Circuit breakingLibrary or meshSame rules everywhere, visible centrally
DNS TTL, connection lifetimeBase image and meshFollow the platform's topology
mTLS and certificatesMesh or platformUniform across languages
The exact split varies; what matters is one written owner for each row.

So for each behaviour, exactly one layer must own it. Retries are a good example: either the application retries, because it knows which calls are idempotent, or the mesh does, configured per route, but never both. And retries need budgets, for example at most 10 percent extra traffic per client, so that even the owning layer cannot cause a storm.

6A Practical Split and How to Measure It

In most large Java-heavy organisations, the split that works is a layered one. The platform owns topology-level behaviour: DNS TTLs and connection lifetimes in base images, mTLS and certificates, and, if a mesh is adopted, outer timeouts and circuit breaking. A shared library owns client defaults and observability. Services own deadlines, per-call timeouts within those defaults, and the decision of which calls are retried. The split is written down in one page that every new service starts from.

To justify the investment and to know if it worked, we measure. We tag postmortems with a cause category such as missing timeout, retry storm or stale DNS, and count them per quarter, along with the hours of customer impact. If these categories caused nine incidents and 40 hours of impact last year, a mesh or a library program costing a few engineer-months is easy to defend, and the same numbers show next year whether it paid off. We also track the coverage directly: the percentage of services on a current starter version, with explicit timeouts on every client, and with retry budgets in place.

Step throughDeciding where a behaviour lives
  1. Does it depend on business meaning, such as idempotency or deadline?
    YesService owns itNoNext question
  2. Must it be identical across languages?
    YesMesh or platform owns itNoNext question
  3. Shared library owns itwith version tracking and auto-upgrades
  4. Write the owner down and measure incidents by category

4 steps in order. Play them, or step through them one at a time.

7Follow-up questions

Would you adopt a service mesh just for timeouts and retries?

Usually not on that alone. A mesh pays off when we also want uniform mTLS, traffic shifting for deployments, and consistent telemetry across several languages. For a Java-only fleet, a well-maintained starter with automated upgrades may give most of the benefit at much lower operational cost.

How do you stop library drift?

Make upgrades nearly free with automated dependency pull requests, keep the starter backward compatible, publish a dashboard of versions per service, and set a policy such as no more than two minor versions behind. Security fixes then reach everyone quickly, and so do new defaults.

What does a retry budget look like in practice?

The client allows retries only while they stay below a share of normal traffic, for example 10 percent over the last ten seconds. When the dependency is healthy, occasional retries go through; when it is failing broadly, the budget runs out and the client stops retrying, so the extra load is capped.

8Conclusion

In this answer, we saw that services, shared libraries and the platform each hold part of the knowledge needed for timeouts, retries and DNS settings. Services know latency needs and idempotency, the platform knows topology, libraries provide defaults but drift, and a service mesh enforces behaviour uniformly across languages without knowing business meaning. Because retries in several layers multiply load, we assign exactly one owner to each behaviour, write it down, and measure incidents linked to these settings to justify the investment and confirm it worked.

What to say in the interviewAbout 80 seconds aloud

Open with

I would not put it all in one place, because each layer knows different things. The service knows its latency budget and which operations are safe to retry.

Then, if they want more

The platform knows the topology, load balancer idle timeouts, DNS failover, certificates. Shared libraries bridge the two with defaults, but they drift, because teams pin old versions, and they only cover one language.

A service mesh can enforce timeouts, retries, circuit breaking and mTLS uniformly across all languages and change them centrally, but it does not know business semantics, like a payment that must never be retried, and it is a significant system to run.

The biggest risk of an unclear split is duplicated retries: three layers retrying three times turns one request into 27 calls on a struggling database. So I would define one owner per behaviour and write it down.

Typically, the platform owns DNS TTLs, connection lifetimes and mTLS; the starter library owns defaults, retry budgets and metrics; and services own deadlines and which calls are retried.

To justify it, I would tag postmortems by cause, like missing timeout or retry storm, and count incidents and impact hours, then track the same numbers and the coverage of the standard afterwards to show the investment paid off.

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 documentation below. 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 "Timeouts, retries and DNS settings are defined differently in every client library and...": https://scrivio-interview-library.netlify.app/java/networking/386596dea3/