Quick revision
The short answer
Yes, in most organisations standardising on one container is worth it, because one container means one body of tuning knowledge, one stream of security patches and one set of dashboards; Spring Boot 4 no longer supports Undertow, so those services have to move anyway (check your version). I would decide with measurements on our real workloads rather than published benchmarks, migrate service by service, since the switch is usually a dependency change plus translating container-specific settings and customisers, and allow exceptions only with a written reason.
What to remember
In this answer, we saw that one servlet container gives an organisation one set of tuning knowledge, patches and monitoring, and that Spring Boot 4 forces Undertow services to move anyway. The choice should come from load tests on real services plus operational factors, the migration is mostly a dependency change with careful translation of container-specific properties and customisers, and exceptions are allowed only with a documented reason.
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.
Yes, in most organisations standardising on one container is worth it, because one container means one body of tuning knowledge, one stream of security patches and one set of dashboards; Spring Boot 4 no longer supports Undertow, so those services have to move anyway (check your version). I would decide with measurements on our real workloads rather than published benchmarks, migrate service by service, since the switch is usually a dependency change plus translating container-specific settings and customisers, and allow exceptions only with a written reason.
Why this question is asked
Container sprawl happens quietly. One team picked Jetty years ago for WebSocket support, another copied an Undertow example from a blog, and most services stayed on Tomcat because it is Boot's default. Each choice was reasonable at the time, but together they mean three sets of CVEs to track, three ways to read thread metrics and three sets of tuning properties that on-call engineers must know. Interviewers ask this design question to see how we weigh consistency against team freedom, and how we run a migration without drama. In this answer, we will look at what each extra container costs, why Spring Boot 4 forces part of the decision, how to choose with real measurements, how the migration works in practice, and how to handle exceptions.
1What Running Three Containers Really Costs
Each embedded container (the HTTP server library inside a Spring Boot jar) has its own thread model, its own property names and its own failure modes. When an incident happens at 3 a.m., the on-call engineer needs to know that the Tomcat busy-thread metric is called one thing and the Jetty one another, and that server.tomcat.threads.max does nothing on a Jetty service.
Security patching multiplies too. A CVE in Tomcat, Jetty or Undertow each needs its own assessment, upgrade and rollout. With one container, a single advisory feed and a single platform-managed version in our Boot parent or bill of materials covers every service. Shared libraries such as a company starter that customises the server also need one implementation instead of three.
2Spring Boot 4 Decides Part of It
Spring Boot 4 targets Jakarta EE 11 and Servlet 6.1, and it removed Undertow support because Undertow did not support that Servlet version. So every Undertow service must move to Tomcat or Jetty as part of the Boot 4 upgrade, whatever we decide about the others. Check your exact version and the release notes, but this turns the question from whether to standardise into which container the Undertow services should land on, which is a natural moment to pick one for everyone.
3Choosing With Real Workloads, Not Benchmarks
Published benchmarks measure hello-world endpoints, where differences of a few percent between containers look important. In a real service, time is dominated by database queries, serialisation and downstream calls, and container differences usually disappear. So we measure our own services: pick two or three representative ones (a high-throughput API, a service with large uploads, one with WebSockets), run the same load test on Tomcat and on Jetty, and compare p99 latency, throughput, memory and startup time.
Then we weigh the non-performance factors, which often decide it: which container the platform team knows, which one our observability and security tooling supports best, and which one is Boot's default. Tomcat usually wins on familiarity and being the default; Jetty is a fine choice if the organisation already has deep Jetty experience. The point is to decide on evidence and write it down.
| Factor | How we measure it | Typical outcome |
|---|---|---|
| Performance | Load test 2 to 3 real services on each | Differences within noise |
| Memory and startup | Container RSS and time to ready | Small differences |
| Operational knowledge | Who on-call knows each one | Strongly favours default |
| Tooling support | Metrics, APM, security scanners | Usually equal or favours Tomcat |
| Boot support | Release notes for target version | Undertow excluded in Boot 4 |
4How the Migration Works
For each service the change is usually small. We exclude the current container starter from the web starter and add the target one, for example spring-boot-starter-tomcat. Boot's general server.* properties, such as server.port, compression and SSL, work unchanged. But container-specific settings and code need attention.
The risky parts are silent: old properties under server.undertow.* are ignored without an error, so a size limit or timeout just disappears. We search each repository for the old prefix and for WebServerFactoryCustomizer beans and any direct use of container classes, translate them, and add a test that checks the important limits, such as rejecting an upload over the allowed size. Access log format, HTTP/2 configuration and WebSocket behaviour are other places where containers differ, so we check them in staging.
I would migrate in waves: first the forced Undertow services as part of the Boot 4 upgrade, then Jetty services as their teams touch them, each with a load test comparison against the previous container in staging.
5Allowing Exceptions Without Losing the Standard
A standard with no exceptions breeds workarounds, and a standard with easy exceptions is not a standard. So exceptions are allowed with a short written reason, such as a measured performance gap or a feature only one container provides, reviewed by the platform group and revisited each year. The exception owner also takes on the extra patching and monitoring work, which keeps the incentive honest. In practice, once the default path is well supported with dashboards and tuning guides, few teams ask to leave it.
6Follow-up questions
Would you force a team to switch if their Jetty service works fine?
Not urgently. I would set the standard for new services and for any service being upgraded anyway, and move the rest during normal maintenance, such as the next major Boot upgrade. Forcing an immediate switch of a stable service costs effort and adds risk for little gain.
How do you keep teams from drifting again?
Make the standard the easy path: a company parent or starter that includes the chosen container, dashboards and alerts built for it, and a build check that flags other container starters. Drift usually happens when the standard is only a document.
Is there any performance case for Jetty or Tomcat that would change the decision?
Sometimes, for example a very large number of WebSocket connections or a special HTTP/2 need. If a load test on our own service shows a meaningful and repeatable gap, that is exactly the kind of documented reason that justifies an exception.
7Conclusion
In this answer, we saw that one servlet container gives an organisation one set of tuning knowledge, patches and monitoring, and that Spring Boot 4 forces Undertow services to move anyway. The choice should come from load tests on real services plus operational factors, the migration is mostly a dependency change with careful translation of container-specific properties and customisers, and exceptions are allowed only with a documented reason.
Open with
I would standardise, mainly for operations. Every container has its own property names, metrics, thread model and CVE stream, so running three means on-call engineers need three sets of knowledge and security has to patch three things.
Then, if they want more
There is also a forcing event: Spring Boot 4 dropped Undertow because it does not support the newer Servlet version, so those services have to move anyway, which is a good moment to pick one target.
To decide, I would not use published benchmarks; I would load test two or three of our real services on Tomcat and Jetty and compare p99 latency, memory and startup. Usually the difference is noise, and then familiarity and tooling decide, which tends to favour Tomcat as Boot's default.
The migration itself is mostly swapping the starter, but the dangerous part is silent: server.undertow or server.jetty properties are ignored after the switch, so I would search for those prefixes and for WebServerFactoryCustomizer beans, translate them, and test limits like upload size in staging.
I would migrate in waves, Undertow first with the Boot 4 upgrade, and allow exceptions only with a written, reviewed reason, with the owning team taking on the extra maintenance.
About this answer
- Last updated
- 12 November 2026
- Versions it names
- Spring Boot 4, Jakarta EE 11
- 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
- Jakarta EE specifications
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 "Your organisation runs Tomcat, Jetty and Undertow across different Spring Boot services....": https://scrivio-interview-library.netlify.app/java/servlets/5f1ac2724f/