Quick revision
The short answer
I would decide per concern with a written architecture principle: concerns that need application context, such as retries tied to business semantics, typed HTTP clients and messaging bindings, belong in libraries like Spring Cloud, while network concerns such as mTLS, traffic shifting, basic retries and discovery often belong in the platform so they work across languages. The rule that matters most is to never do the same thing in both layers, which causes compounded retries and confusing behaviour. We review the split periodically as the platform evolves, and weigh team skills and the real cost of operating a service mesh.
What to remember
In this answer, we decided between Spring Cloud libraries and the platform by asking whether a concern needs application context: business-aware retries, typed clients and messaging bindings go to libraries, while mTLS, traffic shifting, basic retries and discovery often go to the platform. We saw why doing the same thing in both layers causes compounded retries and confusing timeouts, wrote the split as a principle with an owner and a review date, and weighed team skills and the cost of operating a mesh.
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.
I would decide per concern with a written architecture principle: concerns that need application context, such as retries tied to business semantics, typed HTTP clients and messaging bindings, belong in libraries like Spring Cloud, while network concerns such as mTLS, traffic shifting, basic retries and discovery often belong in the platform so they work across languages. The rule that matters most is to never do the same thing in both layers, which causes compounded retries and confusing behaviour. We review the split periodically as the platform evolves, and weigh team skills and the real cost of operating a service mesh.
Why this question is asked
When Spring Cloud started, applications ran on virtual machines and had to bring their own discovery, load balancing and resilience, because nothing underneath provided them. Today Kubernetes provides discovery and configuration, a service mesh can add mutual TLS and retries, and cloud providers sell managed gateways and queues. The same concern can now be solved in two or three places, and teams end up solving it in all of them. Interviewers ask this leadership question to see whether we can set a clear principle for the split. In this answer, we will see why the overlap appeared, find the test that decides each concern, apply it to the usual list, explain why doing things twice is harmful, and set up the review and the people side.
1Why the Overlap Exists
A concern like service discovery used to have one answer for Spring teams: Eureka through Spring Cloud. On Kubernetes, every Service already has a DNS name and the platform tracks which pods are ready. Retries used to be a Spring Retry or Resilience4j decision; with Istio or Linkerd, the sidecar proxy can retry too. Configuration used to come from Spring Cloud Config; now ConfigMaps and secret operators exist.
None of these tools is wrong. The problem is that without a principle, each team chooses differently, and some choose both layers at once. So the leadership task is to decide, per concern, which layer owns it, write that down and make it easy to follow.
2The Test: Does It Need Application Context?
The question that decides most cases is whether the concern needs to understand what the application is doing. A library runs inside the application and knows the method being called, the business operation, the domain types and the transaction. The platform sees connections and HTTP requests, but nothing about meaning; in exchange, it works the same for Java, Go and Python services without any code.
So concerns that depend on meaning go to libraries. A retry policy that knows a payment capture is safe to retry only with the same idempotency key, a typed HTTP client that maps a 404 to CustomerNotFoundException, a Kafka binding that commits offsets after a database transaction: these need application context. Concerns that are about the network go to the platform: encrypting traffic with mTLS, shifting 5 percent of traffic to a new version, basic retries of connection failures, discovering instances, enforcing which service may call which.
| Concern | Owner | Why |
|---|---|---|
| Discovery, basic load balancing | platform (Kubernetes) | same for all languages |
| mTLS and service-to-service identity | platform (mesh) | no code changes, central policy |
| Traffic shifting, canaries | platform | deployment concern |
| Retries of connection failures | platform or library, never both | pick one layer per call path |
| Retries with business semantics | library | needs idempotency keys, domain rules |
| Typed HTTP clients, error mapping | library | needs domain types |
| Messaging bindings, offsets, transactions | library | tied to application logic |
3Never Do the Same Thing Twice
The most damaging pattern is the same concern handled in both layers. Retries are the classic example. Suppose the client library retries 3 times and the mesh sidecar also retries 3 times. One slow call becomes up to 9 attempts at the next service. If that service also calls another one with the same setup, the attempts multiply again, to 27 at the third hop. During a partial outage, this turns a struggling dependency into a crushed one, which is a retry storm.
Timeouts cause a quieter version of the problem. If the library's read timeout is 2 seconds and the mesh's route timeout is 1 second, the mesh cuts the call first and the application sees a 504 instead of its own timeout exception, so its fallback logic never runs and the logs are confusing. Load balancing in both layers, client-side LoadBalancer choosing a pod and then the mesh choosing again, makes both algorithms less effective and the behaviour hard to explain.
7 messages in order. Play them, or step through them one at a time.
With another hop configured the same way, 9 becomes 27.
4Turning It Into a Principle and Reviewing It
I would write the decision as a short architecture principle with a table like the one above, agreed with the platform team and senior engineers from product teams, and publish it with concrete defaults: for example, mesh retries limited to connection failures with one retry, library retries only for idempotent operations with business rules, and a single timeout owner per call path. A platform starter can then configure Spring Cloud clients accordingly, for example disabling LoadBalancer's retries when the mesh owns them.
The split is not permanent. Platforms change: a mesh may be adopted or removed, Kubernetes adds features, managed services appear. So the principle has an owner and a review date, for example once a year or when a major platform change is planned. Each review asks which concerns moved, what incidents showed overlap or gaps, and what the principle should say now.
- Does it need domain or application context?YesLibrary, with a shared starterNoLook at the platform
- Does the platform already provide it?YesUse the platform; turn the library feature offNoLibrary until the platform offers it
- Record the owner in the principleone layer per concern
- Review yearly or on platform change
4 steps in order. Play them, or step through them one at a time.
5Team Skills and the Cost of a Mesh
A service mesh is powerful but not free. It adds a sidecar or node proxy to every pod, with CPU and memory costs, extra latency of usually around a millisecond per hop, upgrades of its own, and a new layer to debug when something goes wrong. A platform team needs real expertise in it, and on-call engineers need to know how to read its metrics and configuration. For a company with 30 services and a small platform team, the honest answer may be that Spring Cloud libraries plus plain Kubernetes are enough, and a mesh would cost more than it saves.
Language mix matters too. If 95 percent of services are Spring Boot, a well-made starter gives most of the benefit of a mesh with skills the teams already have. If the company runs Java, Go, Python and Node services, platform-level solutions become much more attractive, because one configuration covers everyone.
6Follow-up questions
Should we remove Spring Cloud entirely if we adopt a mesh?
No. The mesh replaces network concerns, but typed clients, messaging bindings, gateways with Java filters, contract tests and business-aware resilience still belong in the application. What we remove are the overlapping parts, such as Eureka discovery or LoadBalancer retries.
How do you find existing overlaps?
Inventory the settings: library retry and timeout configuration from each service, and mesh retry and timeout policies from the platform. Comparing them per call path quickly shows where both layers retry or where timeouts conflict. Incident reviews involving retry storms are another good source.
Who decides when teams disagree?
The architecture group or platform leadership, using the principle. The decision and its reason are recorded, so the next team with the same question finds the answer instead of reopening the debate.
7Conclusion
In this answer, we decided between Spring Cloud libraries and the platform by asking whether a concern needs application context: business-aware retries, typed clients and messaging bindings go to libraries, while mTLS, traffic shifting, basic retries and discovery often go to the platform. We saw why doing the same thing in both layers causes compounded retries and confusing timeouts, wrote the split as a principle with an owner and a review date, and weighed team skills and the cost of operating a mesh.
Open with
I would decide per concern with one test: does it need application context? Libraries run inside the application and understand the business operation; the platform understands networks and works for every language.
Then, if they want more
So retries tied to business semantics, like retrying a payment with the same idempotency key, typed HTTP clients with domain error mapping, and messaging bindings tied to transactions belong in libraries such as Spring Cloud.
Network concerns, mTLS, traffic shifting for canaries, discovery, basic retries of connection failures, often fit the platform, Kubernetes or a mesh, because they then work across languages with no code. The most important rule is to never handle one concern in both layers.
Three library retries and three mesh retries make nine calls, and twenty-seven at the next hop, which turns a slow dependency into a retry storm; conflicting timeouts mean the mesh cuts calls before the application's fallback runs.
I would write this as an architecture principle with a table of owners and defaults, agreed with the platform team and senior engineers, and enforce it through a starter that, for example, turns off LoadBalancer retries where the mesh owns them. I would review it yearly or when the platform changes.
And I would be honest about cost: a mesh adds resources, latency and operational skill needs; with mostly Spring services and a small platform team, a good starter on plain Kubernetes may be the better choice.
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 grew in an era of VMs and Netflix OSS; Kubernetes, service meshes and...": https://scrivio-interview-library.netlify.app/spring-boot/spring-cloud/df811f6f89/