Quick revision
The short answer
The standard makes Spring MVC with virtual threads the default for request-response services that use JDBC or JPA, and reserves WebFlux for streaming, very high fan-out, long-lived connections such as SSE and WebSocket, or services whose drivers are non-blocking throughout. Team skill and the maturity of debugging and observability tooling count as criteria, any deviation from the default needs a short design note, and the standard itself is reviewed regularly as virtual-thread support and libraries mature.
What to remember
In this answer, we wrote a standard that makes Spring MVC with virtual threads the default for request-response services with JDBC or JPA, reserves WebFlux for streaming, long-lived connections, very high fan-out and fully non-blocking stacks, and includes team skill and observability maturity as criteria. Deviations go through a short design note with a quick review, and the standard has an owner who revisits it with each Java LTS and Spring Boot major release as virtual-thread support and libraries mature.
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.
The standard makes Spring MVC with virtual threads the default for request-response services that use JDBC or JPA, and reserves WebFlux for streaming, very high fan-out, long-lived connections such as SSE and WebSocket, or services whose drivers are non-blocking throughout. Team skill and the maturity of debugging and observability tooling count as criteria, any deviation from the default needs a short design note, and the standard itself is reviewed regularly as virtual-thread support and libraries mature.
Why this question is asked
Without a standard, each team picks a web stack on its own, often by habit or by what a recent article recommended. The result is a fleet where similar services are built three different ways, platform tooling has to support all of them, and engineers moving between teams relearn the basics. Interviewers ask senior candidates to write such a standard because it tests whether they can turn technical trade-offs into criteria others can apply without them in the room. In this answer, we will set the default and explain why, define when WebFlux is the right choice, add the people and tooling criteria, design the deviation process, and plan how the standard stays current.
1A Quick Recap of the Three Options
Plain Spring MVC runs each request on a platform thread from a pool, typically 200 threads in Tomcat, so concurrency is bounded by the pool. Spring MVC with virtual threads, enabled in Spring Boot 3.2 and later with spring.threads.virtual.enabled=true on Java 21 or later, keeps the same programming model but gives each request a cheap virtual thread, so blocking calls no longer tie up a scarce resource. Spring WebFlux runs on a few event-loop threads with Reactor types and needs non-blocking I/O throughout to deliver its benefits.
For most services, the second option gives the scalability that used to require the third, with the code style of the first. That observation drives the default.
2The Default: MVC With Virtual Threads
The standard says new request-response services that use JDBC or JPA start on Spring MVC with virtual threads on the current LTS Java, Java 25 at the time of writing. The reasons are concrete: imperative code that every Spring developer can read, full JPA and @Transactional support, stack traces that point at our code, thread-local based tools such as MDC logging and security contexts that just work, and concurrency in the thousands of requests without tuning a thread pool.
The standard also names the known caveats so teams are not surprised. Connection pools still bound database concurrency, so virtual threads do not make the database faster. Libraries that pin carrier threads were a concern on Java 21; Java 24 and later removed pinning for synchronized, so running on Java 25 avoids most of it. And limits that used to come implicitly from the thread pool, such as how many calls hit a partner API at once, must now be explicit, for example with a semaphore or a bulkhead.
- Streaming, SSE or WebSocket at scale?YesWebFluxNoNext question
- Very high fan-out per request?YesWebFlux, if clients are non-blockingNoNext question
- All drivers non-blocking and team skilled?YesWebFlux allowed with design noteNoNext question
- MVC with virtual threadsthe default for JDBC and JPA services
- Record the choicein the service's design note
5 steps in order. Play them, or step through them one at a time.
3When WebFlux Is the Right Choice
The standard lists the workloads where WebFlux earns its cost. The first is streaming: endpoints that send large results or continuous data with backpressure, such as exporting millions of rows or pushing market data. The second is long-lived connections, SSE and WebSocket, where tens of thousands of mostly idle connections are cheaper on event loops. The third is very high fan-out, where one request calls 20 or 50 downstream services and composes the results, which Reactor's operators express well. The fourth is any service whose whole I/O path is already non-blocking, such as a gateway built on Spring Cloud Gateway or a service using R2DBC and reactive messaging clients from the start.
It also lists what is not a reason: general performance, since benchmarks for typical services show little difference against virtual threads, and fashion. A team that wants WebFlux for a plain CRUD service must show measured numbers.
4People and Tooling Criteria
Technical fit is half the decision. The standard asks whether the owning team has reactive experience, at least two people who have debugged a production reactive service, because operator stack traces, lost context and accidental blocking are hard to diagnose without it. It asks whether our observability tooling handles the stack: distributed tracing and MDC logging with Reactor's context propagation via Micrometer context-propagation, profiling that understands event loops, and BlockHound in tests to catch blocking calls. If these are missing, the cost of WebFlux includes building them, and the design note must say who does that.
| Criterion | MVC with virtual threads | WebFlux |
|---|---|---|
| Typical CRUD with JDBC or JPA | default | not without measured need |
| Streaming and backpressure | possible, limited | preferred |
| SSE or WebSocket at scale | possible | preferred |
| Fan-out of 20+ calls per request | works with structured code | preferred if clients are reactive |
| Team reactive experience needed | no | yes, at least two people |
| Tracing and MDC logging | works out of the box | needs context propagation set up |
5The Deviation Process and Keeping the Standard Current
A default only works if deviating is possible and cheap. A team that wants WebFlux, or plain MVC without virtual threads, writes a one-page design note: the workload, the measured or estimated numbers, the drivers in the I/O path, who on the team has the skills, and how they will observe it. An architecture reviewer answers within a week. The notes are kept, so the organisation learns which exceptions were justified.
The standard has an owner and a review date, for example every year and whenever a new Java LTS or Spring Boot major release arrives. Each review asks what has changed: library support for virtual threads, new structured-concurrency APIs, observability tooling for reactive code, and what the deviation notes and incidents of the past year teach. The goal is that the default stays the best choice for most teams, and the standard changes when the evidence does.
6Follow-up questions
Why not let each team choose freely?
Because the cost of a stack is not paid only by the team that chooses it. Platform libraries, observability, security components, onboarding and incident response all have to support every stack in use. A default with a cheap exception path keeps the fleet coherent while still allowing the cases that genuinely benefit from WebFlux.
What about existing WebFlux services?
The standard covers new services. Existing reactive services stay as they are unless they need significant change, are hard to staff, or show no measured benefit, in which case a move to MVC with virtual threads is planned as part of that work rather than as a separate rewrite program.
Does virtual threads support need anything special in Spring Boot?
Setting spring.threads.virtual.enabled=true switches Tomcat request handling and several Spring executors, such as those for @Async and scheduled tasks in recent versions, to virtual threads; check your Boot version for exactly which components follow the property. Teams should also review places where the old thread pool implicitly limited concurrency.
7Conclusion
In this answer, we wrote a standard that makes Spring MVC with virtual threads the default for request-response services with JDBC or JPA, reserves WebFlux for streaming, long-lived connections, very high fan-out and fully non-blocking stacks, and includes team skill and observability maturity as criteria. Deviations go through a short design note with a quick review, and the standard has an owner who revisits it with each Java LTS and Spring Boot major release as virtual-thread support and libraries mature.
Open with
I'd write the standard around a clear default and a cheap way to deviate. The default for new request-response services using JDBC or JPA is Spring MVC with virtual threads on the current LTS Java.
Then, if they want more
It keeps imperative code that everyone can read, full JPA and transactions, readable stack traces, thread-local tools like MDC that just work, and it handles thousands of concurrent requests without pool tuning.
I'd note the caveats: the connection pool still limits the database, pinning was an issue on Java 21 but mostly gone from Java 24, and concurrency limits the thread pool used to give us implicitly, like how hard we hit a partner API, now need an explicit bulkhead.
WebFlux is the choice for streaming with backpressure, for long-lived connections like SSE and WebSocket at scale, for very high fan-out per request, or when the whole I/O path is non-blocking anyway, like a gateway. General performance is not a reason by itself; for typical services the difference against virtual threads is small.
Then I'd add people and tooling criteria: the team should have real reactive experience, and tracing, MDC logging with context propagation, and BlockHound in tests must be in place. To deviate, a team writes a one-page design note with the workload, numbers, drivers and skills, and gets an answer within a week.
Finally the standard has an owner and is reviewed yearly and at each Java LTS or Boot major release, because virtual-thread support and libraries keep changing.
About this answer
- Last updated
- 12 November 2026
- Versions it names
- Java 21, Java 25, Java 24, Spring Boot 3.2
- 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 Framework reference, Spring WebFlux, Project Reactor reference guide
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 "Set a company standard for choosing among Spring MVC, Spring MVC with virtual threads...": https://scrivio-interview-library.netlify.app/spring-boot/webflux/2dc3bf5fb2/