Scrivio Interview library
DesignAdvanced6 min read · updated 12 November 2026

Your organisation has MVC services and WebFlux services. With virtual threads available, would you standardise on one stack for new services?

Yes, I would standardise on Spring MVC with virtual threads as the default for new services, because it handles high concurrency for blocking I/O with simple, familiar code, and one default stack reduces training, shared libraries and support work. WebFlux stays allowed by exception where there is a clear need, such as streaming, back-pressure or fully non-blocking pipelines with reactive drivers. Existing WebFlux services are not migrated by default; we migrate only where the cost is clearly repaid.

Why this question is asked

For years, the choice between Spring MVC and WebFlux was partly a choice about threads. MVC used one platform thread per request, so services making many slow downstream calls ran out of threads, and WebFlux's non-blocking model was the answer. Virtual threads, final since Java 21, change that calculation. Interviewers ask this at a senior level to see whether we can re-examine an architecture decision when the underlying constraint moves. In this answer, we will recap why WebFlux was adopted, see what virtual threads change with numbers, look at what WebFlux still does better, and then set the standard and the plan for existing services.

1Why Teams Adopted WebFlux in the First Place

A classic Spring MVC service on Tomcat runs each request on a platform thread from a pool of 200 by default. Platform threads are operating system threads, each with its own stack of up to around a megabyte, so we cannot simply create tens of thousands of them. If each request waits 500 ms on a downstream call, 200 threads can complete at most about 400 requests per second, no matter how idle the CPU is.

WebFlux removes that limit by never blocking. A small number of event-loop threads handle all requests, and waiting is expressed as Mono and Flux pipelines that resume when data arrives. The price is a different programming model: every library in the path must be non-blocking, stack traces are harder to read, ThreadLocal-based context needs special handling, and developers need reactive skills.

2What Virtual Threads Change

A virtual thread is a thread managed by the JVM rather than the operating system. When it blocks on I/O, the JVM unmounts it from its carrier platform thread and parks it cheaply, so millions can exist. In Spring Boot 3.2 and later, spring.threads.virtual.enabled=true makes Tomcat run each request on a new virtual thread, and Boot's task executors use them too.

So the same blocking MVC code, a RestClient call and a JDBC query, can now have thousands of requests waiting concurrently without exhausting a pool. In the example above, the limit of 400 requests per second disappears; the new limits are the downstream service, the connection pools and memory. That is roughly the capacity benefit that drove many WebFlux adoptions, with code that reads top to bottom and uses ordinary debugging and ThreadLocal context.

Java
# application.properties (Spring Boot 3.2+, Java 21+)
spring.threads.virtual.enabled=true
@GetMapping("/orders/{id}/summary")
Summary summary(@PathVariable long id) {
Order o = orders.find(id); // JDBC, blocks a virtual thread cheaply
Customer c = customers.get(o.customerId()); // RestClient call, about 300 ms
return new Summary(o, c); // plain code, plain stack traces
}

There are caveats to plan for. Connection pools still bound concurrency: with 10,000 waiting requests and a database pool of 50, requests queue for connections, so we need timeouts and bulkheads, limits on how many concurrent calls go to each dependency. On Java 21, blocking inside synchronized blocks could pin a virtual thread to its carrier; this was largely fixed in Java 24, so with Java 25 LTS it matters much less, but older libraries are worth checking.

3Where WebFlux Still Fits Better

Virtual threads make blocking cheap; they do not add streaming semantics. WebFlux remains the better tool when the workload is a stream rather than request and response: server-sent events to thousands of clients, WebSocket fan-out, or proxies that pass large bodies through without buffering. Its back-pressure, where a slow consumer signals the producer to slow down, is built into the Flux model, and doing the same with threads takes deliberate work.

It also fits fully non-blocking pipelines that already use reactive drivers end to end, such as R2DBC or reactive Kafka clients, built by a team that is fluent in Reactor. In those cases, switching to MVC would mean rewriting working code without gaining much.

Default and exceptions for new services
WorkloadStackReason
REST API with DB and HTTP callsMVC with virtual threadssimple code, high concurrency
Batch-like or CPU-heavy endpointsMVCvirtual threads do not help CPU work
Thousands of SSE or WebSocket streamsWebFlux by exceptionstreaming and back-pressure
Streaming proxy for large bodiesWebFlux by exceptionno buffering, flow control
Existing reactive pipeline, skilled teamkeep WebFluxrewrite cost not repaid

4Why One Default Stack Is Worth It

Every supported stack doubles a lot of work: shared libraries for logging, security, tracing and error handling must exist for both servlet and reactive APIs; testing guides, templates and on-call runbooks must cover both; and developers moving between teams must learn both models. Across, say, 60 services, that cost dwarfs the benefit WebFlux brings to the handful of services that truly need it.

So the standard is MVC with virtual threads for new services, with WebFlux allowed when the team states a clear reason, such as streaming, back-pressure or reactive drivers, and the platform team agrees it can support it. The shared starters keep reactive variants for those services, but new features land in the MVC variant first.

5Planning for Existing WebFlux Services

Migration is not always worth it. A WebFlux service that works, is understood by its team and is not causing incidents stays as it is. We look for migration candidates where the reactive code is causing real cost: frequent incidents from lost context or blocked event loops, a team that no longer has reactive skills, or code that calls blocking libraries anyway, which gives the worst of both models.

For those, migration is gradual: move endpoints to an MVC version of the service behind the same routes, measure latency and resource use before and after, and retire the reactive version once it matches. Measuring matters because virtual threads change memory and CPU profiles, and we want evidence, not assumptions, before converting more services.

6Follow-up questions

Do virtual threads make MVC as scalable as WebFlux?

For typical I/O-bound request and response services, close enough that the difference rarely matters, because both are then limited by downstream services and pools. WebFlux can still use less memory per waiting request and handles streaming and back-pressure more naturally, which is why it remains the exception for those workloads.

What should a team check before turning on virtual threads?

That the service runs on Java 21 or later, ideally 25; that connection pools and downstream timeouts are set, since concurrency will rise; that no library relies on large ThreadLocal caches per thread; and, on Java 21, that hot paths do not block inside synchronized blocks. Then load-test and compare latency and memory with the previous setup.

Can a service mix both stacks?

Not in one application in a useful way: Spring Boot chooses servlet or reactive web based on the classpath and configuration. A service can use the reactive WebClient inside MVC, though, and with virtual threads RestClient is usually simpler.

7Conclusion

In this answer, we saw that WebFlux was often adopted to escape the platform thread limit of blocking MVC, and that virtual threads remove much of that limit while keeping simple, blocking code. WebFlux still fits streaming, back-pressure and fully reactive pipelines. Standardising on MVC with virtual threads for new services reduces training, library and support work, with WebFlux by exception for clear needs, and existing WebFlux services are migrated only where measurements show the cost is repaid.

What to say in the interviewAbout 90 seconds aloud

Open with

I'd standardise, with MVC on virtual threads as the default for new services. The original reason many teams picked WebFlux was the thread limit: 200 platform threads with 500 milliseconds of waiting per request caps you at about 400 requests a second.

Then, if they want more

With Java 21 and later and spring.threads.virtual.enabled in Boot 3.2 and up, each request runs on a virtual thread, and blocking on JDBC or a RestClient call is cheap, so the same simple code handles thousands of concurrent waits. The new limits are connection pools and downstream services, so we still need timeouts and bulkheads.

WebFlux still has real strengths: streaming to many clients, back-pressure, proxies that pass large bodies through, and pipelines that are reactive end to end with R2DBC or reactive Kafka. So it stays allowed by exception, with a stated reason.

The case for one default is cost: every stack needs its own versions of shared libraries for security, tracing and error handling, its own templates, tests and runbooks, and people moving between teams have to learn both. Across dozens of services, that's much bigger than WebFlux's benefit for the few that need it.

For existing WebFlux services I wouldn't force a migration. If a service works and its team knows Reactor, it stays. I'd migrate where reactive code is causing incidents or the team lost the skills, and do it gradually, measuring latency and resources before and after.

About this answer

Last updated
12 November 2026
Versions it names
Java 21, Spring Boot 3.2, Java 24, Java 25
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 "Your organisation has MVC services and WebFlux services. With virtual threads available...": https://scrivio-interview-library.netlify.app/spring-boot/mvc-architecture/f809ed0b3c/