Interview Prep Zoneby CuriouserLabs

Question 5 of 5 · architect level

Spring MVC vs WebFlux — threading models, when reactive pays off, and how virtual threads change the calculus.

🎤 Say this first

MVC: thread-per-request on a pool; blocking I/O parks the thread — simple model, limited by thread count (historically). WebFlux: event loops + non-blocking I/O; requests are Reactor pipelines multiplexed over few threads — huge I/O concurrency, but the whole stack (DB driver: R2DBC, clients) must be non-blocking, and you pay in debuggability, stack traces, and team cognitive load. Virtual threads (Boot 3.2+: one property) give MVC most of the scalability argument for free, so the honest 2026 answer: MVC + virtual threads by default; WebFlux where streaming semantics — backpressure, SSE/websocket fan-out, composition of many event sources — are the actual requirement.

The full picture

DimensionMVC (+ virtual threads)WebFlux
Programming modelimperative, blocking-styleReactor: Mono/Flux pipelines everywhere (viral)
Scalability limiterwas threads; with VTs → downstream capacityevent loop discipline (one blocking call stalls a core)
Ecosystem constraintany JDBC/clientsneeds R2DBC, reactive clients end-to-end
Debugging/on-callnormal stack traces, thread dumpsassembly vs execution time, operator fusion — training required
Backpressurenone native (queue/timeout at edges)first-class (request(n) protocol)
  • The classic WebFlux failure mode: one blocking JDBC call or heavyweight computation on an event loop degrades the entire instance — and it's invisible in code review unless the team is trained (BlockHound exists for a reason).
  • The classic MVC failure mode was pool exhaustion under slow downstreams — the thing virtual threads largely dissolve (with the caveat that DB pools and downstreams still cap real throughput).
  • Where WebFlux/reactive is still the right call: high-fan-out aggregation gateways, streaming (SSE, live feeds), backpressure-sensitive pipelines, and Kafka-to-socket style flows. WebClient, notably, is worth using even from MVC.
  • Team factor is architectural: a reactive codebase is a hiring and on-boarding decision, not just a runtime one.

🔄 Likely follow-up questions

  • What is backpressure concretely in Reactor, and what happens without it?
  • Can you mix: MVC app using WebClient with virtual threads — what do you gain/lose?
  • How do you migrate a WebFlux codebase that never needed to be reactive?