Quick revision
The short answer
Platform features such as Kubernetes Services and a service mesh work for every language and team without code changes, but they know little about what a request means; application libraries give fine control, such as fallbacks and per-call settings, but must be upgraded in every service. So we move generic concerns like discovery, mTLS and basic retries to the platform once it is mature in our organisation, keep business-aware behaviour such as fallback logic and idempotency in the application, and avoid implementing the same concern in both layers, for example retries in the mesh and in the code.
What to remember
In this answer, we saw that platform features cover every language without code changes but know little about business meaning, while application libraries give fine control at the cost of upgrading every service. We moved generic concerns such as discovery, mTLS and basic retries to the platform when it is mature, kept business-aware behaviour such as fallbacks and idempotency in the application, assigned one owning layer per concern to avoid duplicated retries and timeouts, and planned each move as a gradual migration.
Your turn
Answer it aloud as you would in the interview, or type your answer below. Then show one part at a time and compare.
Platform features such as Kubernetes Services and a service mesh work for every language and team without code changes, but they know little about what a request means; application libraries give fine control, such as fallbacks and per-call settings, but must be upgraded in every service. So we move generic concerns like discovery, mTLS and basic retries to the platform once it is mature in our organisation, keep business-aware behaviour such as fallback logic and idempotency in the application, and avoid implementing the same concern in both layers, for example retries in the mesh and in the code.
Why this question is asked
Ten years ago, a Spring Cloud application carried its own discovery client, load balancer, circuit breaker and gateway, because the infrastructure offered none of these. Today Kubernetes and service meshes such as Istio or Linkerd provide discovery, routing, retries, timeouts and encryption between services. That leaves every organisation with the question of where each concern should live. Interviewers ask this leadership question because getting it wrong creates either duplicated, conflicting behaviour or a platform that cannot express what the business needs. In this answer, we will compare the two layers, set a rule for generic concerns, set a rule for business-aware ones, look at the danger of duplication, and plan the transition.
1What Each Layer Is Good At
A platform feature runs outside the application. A Kubernetes Service resolves names and balances connections; a service mesh puts a proxy next to each service (or in the node) that can add mutual TLS, retries, timeouts, traffic splitting and metrics to every call. Because it runs outside the code, it works the same for Java, Go and Python services and needs no code change or library upgrade. The limit is that it sees requests as network traffic: it knows the path and status code, but not whether a failed call can be safely repeated or what a sensible fallback would be.
An application library, such as Resilience4j or Spring Cloud LoadBalancer, runs inside the code. It can make decisions per call with full knowledge of the business: return cached prices if the pricing service is down, retry a payment only with its idempotency key, use a 200 ms timeout for one call and 2 seconds for another. The cost is that every service carries the library, and every upgrade or policy change requires a release of every service.
| Aspect | Platform (Kubernetes, mesh) | Application library |
|---|---|---|
| Languages covered | All, no code change | One per library |
| Changing a policy | Configuration, central | Release every service |
| Knows business meaning | No, sees traffic | Yes, per call |
| Good for | Discovery, mTLS, basic retries, metrics | Fallbacks, idempotency, per-call budgets |
| Main risk | Generic behaviour where meaning matters | Drift and slow upgrades across services |
2Move Generic Concerns to the Platform
Concerns that are the same for every service, and do not depend on what the request means, belong in the platform once it is mature in our organisation. Service discovery is the clearest case: Kubernetes already knows which pods are ready, so a separate Eureka registry adds nothing. Mutual TLS, encrypting and authenticating every service-to-service call, is better done by a mesh than by forty teams configuring certificates. Basic connection-level retries, traffic metrics and gradual traffic shifting for canary releases are similar.
The condition mature matters. If the platform team cannot yet operate a mesh reliably, with upgrades, debugging tools and on-call, moving a critical concern there trades a known library for an unknown failure mode. I would move concerns one at a time, starting with discovery and mTLS, and only after the platform has shown it can run them.
3Keep Business-Aware Behaviour in the Application
Some decisions need knowledge that only the code has. What to show when recommendations are unavailable, whether to use a cached exchange rate, whether a failed order creation may be retried without charging twice: these depend on the business, and a proxy cannot make them. Fallback logic, idempotency handling and per-operation time budgets stay in the application, typically with Resilience4j or Spring Cloud Circuit Breaker.
Idempotency deserves special attention. A mesh can be told to retry on a 503, but it cannot know whether the first attempt already created an order. Only the application can guarantee that a retry is safe, for example by checking an idempotency key, so the decision about which calls are retried should be informed by the application, even if the retry itself happens in the mesh.
4Avoid Doing the Same Thing in Both Layers
The most damaging outcome is duplication. If the mesh retries a failed call 3 times and the application's client also retries 3 times, a single failing downstream call becomes up to 16 attempts (4 from the application, each of which the mesh tries 4 times). During an outage, that multiplies load on the struggling service at exactly the wrong moment, a retry storm. The same goes for timeouts: if the mesh times out at 1 second and the application at 3, the application's setting never takes effect, and debugging becomes confusing.
So for each concern we decide one owning layer and write it down: retries for idempotent reads in the mesh, no retries in application clients except where business logic needs them; timeouts as a per-call budget in the application, with the mesh timeout set slightly longer as a safety net.
- Same for every service, no business meaning?YesCandidate for the platformNoKeep in the application
- Is the platform mature for it?YesMove it, remove the library settingNoKeep in library for now, plan the move
- Record the owning layerone layer per concern, no duplicates
3 steps in order. Play them, or step through them one at a time.
5Planning the Transition
Moving a concern is a migration like any other. For discovery, we switch services from Eureka to Kubernetes Service names (or Spring Cloud Kubernetes' DiscoveryClient) one at a time and retire the Eureka cluster when the last client leaves. For mTLS, we enable the mesh in permissive mode first, accepting both plain and encrypted traffic, and switch to strict once every service is in the mesh. For retries, we remove application retry settings in the same change that enables mesh retries, so there is never a period with both.
Finally, the platform team publishes a short guide stating which layer owns each concern, with the defaults, so every team designs new services the same way.
6Follow-up questions
What if some services do not run on Kubernetes?
Then the platform cannot cover them yet, and either the mesh is extended to those hosts, which some meshes support, or those services keep library-based discovery and resilience until they move. The guide should state the rule for each kind of environment.
Does a service mesh make Resilience4j unnecessary?
No. The mesh can handle connection-level retries, timeouts and outlier detection, but circuit breakers with business fallbacks, bulkheads around specific operations and per-call budgets still need the application. Many organisations use both, with clearly separated responsibilities.
How do you decide the platform is mature enough?
When the platform team can upgrade it without incidents, there are tools and runbooks for debugging traffic problems, it has on-call coverage, and a few services have run critical traffic through it for some months. Before that, generic concerns can stay in libraries without harm.
7Conclusion
In this answer, we saw that platform features cover every language without code changes but know little about business meaning, while application libraries give fine control at the cost of upgrading every service. We moved generic concerns such as discovery, mTLS and basic retries to the platform when it is mature, kept business-aware behaviour such as fallbacks and idempotency in the application, assigned one owning layer per concern to avoid duplicated retries and timeouts, and planned each move as a gradual migration.
Open with
I would decide by the nature of each concern. Platform features, Kubernetes Services and a service mesh, work for every language and team without code changes, and policies can be changed centrally, but they only see network traffic, not business meaning.
Then, if they want more
Application libraries like Resilience4j or Spring Cloud LoadBalancer give fine control per call, such as fallbacks and different time budgets, but every service has to carry and upgrade them.
So generic concerns that are the same everywhere, like discovery, mutual TLS, basic retries for idempotent calls and traffic metrics, I would move to the platform, but only once the platform team has shown it can operate it reliably.
Business-aware behaviour stays in the application: what to return when a dependency is down, whether a cached value is acceptable, and idempotency, because only the code knows whether a retry is safe. The big rule is to avoid doing the same thing in both layers.
If the mesh retries three times and the client also retries three times, one failing call becomes sixteen attempts during an outage. So for each concern we pick one owning layer, write it down in a platform guide, and migrate one concern at a time, removing the library setting in the same change that turns on the platform feature.
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.
- Official documentation
- Spring Cloud documentation, Resilience4j documentation
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 "Spring Cloud Netflix components were once the standard; now platforms like Kubernetes...": https://scrivio-interview-library.netlify.app/spring-boot/spring-cloud/796fa0601a/