Scrivio Interview library
ScenarioPrincipal5 min read · updated 12 November 2026

A cloud provider's managed load balancing and service discovery would replace your self-run Spring Cloud discovery and client-side balancing. How do you weigh the reduced operations against vendor dependency over a ten-year horizon?

Managed load balancing and discovery remove the patching, scaling and on-call work of running Eureka or Consul ourselves, which is a real and recurring saving. The price is that traffic management becomes tied to one provider's APIs and pricing, which makes multi-cloud or an exit harder. Over ten years I would accept the dependency where it is cheap to reverse, by keeping application code dependent only on logical service names and standard protocols such as DNS and HTTP, estimating the exit cost now, and refusing the dependency where provider-specific SDKs would spread into every service's code.

Why this question is asked

Self-running service discovery made sense when Spring Cloud Netflix was the standard stack, but every cloud provider now offers managed load balancers, service discovery and service networking. Moving saves operational effort, but ten years is longer than most technology choices last, and prices, providers and strategies change in that time. Interviewers ask this senior scenario to see whether we can reason about lock-in as a cost to measure rather than as something to avoid at all costs. In this answer, we will weigh what we gain, what we risk, how to design so the mechanism can change underneath, how to estimate exit cost, and how to decide.

1What We Gain From Managed Services

Running discovery ourselves means running a cluster of Eureka or Consul servers in every environment and region: patching them, upgrading them in step with Spring Cloud, scaling them as services grow, monitoring them, and being paged when they misbehave. Client-side load balancing libraries also need upgrading in every service. Over ten years that is a steady cost in engineer time, and the knowledge lives with a few people.

A managed service takes most of that away. The provider patches, scales and runs it, usually with an availability commitment, and it integrates with the provider's other services, such as autoscaling and health checks. The engineers who ran discovery can work on something that differentiates the business.

2What We Risk Over Ten Years

The risk is dependency. Managed discovery and load balancing are configured through the provider's APIs, often through infrastructure code written for that provider, and sometimes through SDKs called from application code. Prices are set by the provider and can change. If the company later wants a second cloud for resilience or negotiation, or must move because of an acquisition, regulation or cost, everything tied to those APIs has to be rebuilt.

Not all dependency is equal, though. Configuration in infrastructure code for one platform is moderately expensive to change. Provider SDK calls inside the code of 200 services are very expensive to change, because every service must be edited, tested and redeployed.

3Keeping the Mechanism Replaceable

The design goal is that application code knows only logical service names and standard protocols, so the mechanism underneath can change without touching it. A service calls http://inventory or inventory.internal over HTTP, resolved through DNS, and does not know whether that name is answered by Eureka, a cloud provider's service discovery, a Kubernetes Service or a mesh. Configuration such as the base URL per dependency lives in properties, not code.

Java
// Replaceable: only a logical name and HTTP
@Bean RestClient inventory(RestClient.Builder b, @Value("${clients.inventory.url}") String url) {
return b.baseUrl(url).build(); // http://inventory.internal today, anything tomorrow
}
// Hard to replace: provider discovery SDK called from business code
// ServiceDiscoveryClient sd = ProviderSdk.discovery();
// Instance i = sd.discoverInstances("prod-ns", "inventory").get(0); // in 200 services

Notice that the first version would work unchanged if we moved from Eureka to managed discovery and later to something else. The second version would need edits in every service. The decision about managed services is really a decision about which of these two shapes we allow.

4Estimating the Exit Cost Now

Lock-in becomes manageable when we price it before we commit. We write down what would have to change to move away in, say, year six: application code, infrastructure code, operational runbooks, monitoring, and the skills needed. For each, we estimate the effort. If exit means rewriting infrastructure modules for discovery and DNS over a few weeks, the dependency is cheap to reverse and the operational saving clearly wins. If it means editing every service, the dependency is expensive and needs a strong reason.

Exit cost of each way to adopt managed discovery
Where the dependency livesExit effortVerdict
DNS names and HTTP only in codechange infrastructure, weeksaccept
Provider config in infrastructure coderewrite modules, weeks to monthsaccept, keep it in one place
Provider-specific features in routingredesign some traffic rulesaccept selectively
Provider SDK calls in every serviceedit and redeploy all servicesavoid
Accept dependency where it is cheap to reverse; avoid it where it spreads into code.

5Making the Decision

For most organisations the answer over ten years is to take the managed services, but on our terms. We adopt them through standard interfaces, keep provider configuration in a small number of infrastructure modules owned by the platform team, forbid provider SDKs in application code for traffic management, and record the exit estimate with the decision. We revisit it when something material changes: a large price change, a multi-cloud requirement, or a regulatory demand.

There are cases to stay self-run: a hard multi-cloud requirement today, very specific balancing behaviour the provider cannot offer, or a regulatory need to keep the control plane on our own infrastructure. Even then, the same design rule, logical names and standard protocols in code, keeps the next change cheap.

6Follow-up questions

Is multi-cloud a good reason to avoid managed services?

Only if multi-cloud is a real requirement, not a hypothetical one. Running everything in a provider-neutral way has its own permanent cost. Designing so that a move is possible, with logical names and standard protocols, is usually far cheaper than running two clouds just in case.

What about the Spring Cloud code we already have?

If services call each other by logical names through a @LoadBalanced builder, the change is mostly configuration: point the names at DNS entries served by the managed discovery, remove the load balancer starter, and use plain builders. Services that use DiscoveryClient directly in business code need refactoring first.

How do you keep the decision honest over ten years?

Write the exit estimate and the assumptions into an architecture decision record, then review it on a schedule, for example every two years, or when pricing or strategy changes. If the estimate has grown because provider-specific code crept in, that is the signal to clean up.

7Conclusion

In this answer, we weighed the operational saving of managed load balancing and discovery, no patching, scaling or on-call for our own registry, against tying traffic management to one provider's APIs and pricing. We saw that the risk depends on where the dependency lives: logical service names and standard protocols in code keep it cheap to reverse, while provider SDKs in every service make it expensive. So we estimate exit cost up front, accept the dependency where reversal is cheap, avoid it where it spreads into code, and review the decision when prices or strategy change.

What to say in the interviewAbout 80 seconds aloud

Open with

I would treat lock-in as a cost to measure, not something to avoid at any price. The managed service removes real, recurring work: we stop patching, scaling and being paged for Eureka or Consul in every region, and stop upgrading discovery libraries in every service, which over ten years is a lot of engineering time.

Then, if they want more

The cost is that traffic management depends on one provider's APIs and prices, which makes a move or multi-cloud harder. The key is where that dependency lives.

If application code only knows logical names like inventory.internal and talks HTTP resolved through DNS, the mechanism underneath can change from Eureka to managed discovery to a mesh without touching services, and exit means rewriting some infrastructure modules. If provider SDKs get called from business code in 200 services, exit means editing all of them.

So I would estimate the exit cost now, write it into the decision record, adopt the managed service through standard interfaces, keep provider configuration in a few platform-owned infrastructure modules, and forbid provider SDKs for traffic in application code.

I would stay self-run only for a real multi-cloud or regulatory requirement, and review the decision every couple of years or when pricing changes.

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 "A cloud provider's managed load balancing and service discovery would replace your...": https://scrivio-interview-library.netlify.app/spring-boot/http-clients/ad8ee4152c/