Scrivio Interview library
LeadershipPrincipal6 min read · updated 12 November 2026

Java went from Future (5) to CompletableFuture (8) to Flow and reactive libraries (9 and later) to virtual threads (21) and structured concurrency (preview). What does this sequence tell you about where to place long-term bets for asynchronous programming in your organisation?

The sequence shows each step fixing the previous one's main pain: Future had no composition, CompletableFuture added composition but split code into callbacks, reactive libraries added streaming and backpressure at a steep learning and debugging cost, and virtual threads let ordinary sequential code scale. The lesson for long-term bets is that approaches which keep code simple and close to the platform tend to last longer than framework-specific styles. So I would bet on plain code on virtual threads, keep async abstractions thin at the edges, and adopt structured concurrency once it is final, so that the next shift does not require rewriting business logic.

Background to this question

Every few years, Java's concurrency story changes, and organisations that bet heavily on one style pay for it when the next one arrives: services that are hard to staff, libraries that need rewriting, and engineers who must learn yet another model. A senior leader is expected to read the history for its pattern and to place bets that age well. In this answer, we will walk through each step and what it fixed, see the common thread, turn it into principles for long-term decisions, and show what that looks like in a real organisation with an example.

1Each Step and What It Fixed

Java 5 introduced Future with ExecutorService. It gave us a handle to a result computed on another thread, but the only way to use the result was to block on get(). There was no way to say what to do next when the value arrived, so combining several async results meant blocking threads.

Java 8 added CompletableFuture, which brought composition: thenApply, thenCompose, allOf and the rest. Threads no longer had to wait, but logic was now split into callbacks. Stack traces showed pool internals instead of our call path, exceptions arrived wrapped, and thread-local context disappeared between stages.

Reactive libraries such as RxJava and Reactor, with the Flow interfaces standardised in Java 9, went further. They added streams of values and backpressure, letting a slow consumer tell a fast producer to slow down. But they asked engineers to express all logic as operator chains, with their own error model, their own context, their own testing tools and a steep learning curve. Debugging a failed pipeline became a specialist skill.

Java 21 made virtual threads final. Blocking became cheap, so ordinary sequential code, one thread per request, scales to tens of thousands of concurrent requests. Structured concurrency, still a preview in Java 25, adds a way to fan out within that sequential style, with failures and cancellation tied to a scope.

Java's async steps and their trade-offs
StepWhat it fixedWhat it cost
Future (Java 5)results from another threadno composition; blocking get()
CompletableFuture (Java 8)non-blocking compositioncallback style, wrapped errors, lost context
Flow and reactive (Java 9+)streams and backpressuresteep learning and debugging cost
Virtual threads (Java 21)cheap blocking, sequential code scalespinning cases to watch
Structured concurrency (preview)scoped fan-out with cancellationnot final yet in Java 25

2The Common Thread

Looking at the whole sequence, the async styles were mostly workarounds for one constraint: platform threads were too expensive to block. Each workaround asked engineers to write code differently from how they think about the problem. When the platform removed the constraint with virtual threads, the most natural style, straight-line code, became viable again.

There is a second thread too. The styles that required the biggest change in how code is written, reactive pipelines in particular, carried the highest cost when the landscape moved: whole services written in a vocabulary that new hires must learn and that the platform no longer requires for most uses. The styles closest to plain Java, ordinary methods and exceptions, needed the least change.

3Principles for Long-Term Bets

From this I draw three principles. First, bet on what keeps code simple and close to the platform. Code that reads as sequential methods with ordinary exceptions works with every debugger, profiler and engineer, and it benefits automatically when the JDK improves. Framework-specific styles last only as long as the framework's reason for existing.

Second, keep abstractions thin, so the next move does not require rewriting business logic. The business rules of an order service should not know whether its data came through a future, a Mono or a blocking call. Put the concurrency mechanism in a small layer at the edges, such as clients and a fan-out helper, and keep plain values in the domain code.

Third, use specialised tools only where they bring something the simple style cannot. Reactive streams are still the right tool for true streaming with backpressure. That is a narrow, justified use, not a default for every service.

Step throughWhere the concurrency mechanism should live
  1. Edges: clients and fan-out helperfutures, scopes or reactive adapters live only here
  2. Application servicesplain method calls on virtual threads
  3. Domain logicplain values and exceptions, no concurrency types

3 layers, from the top down. Step through them one at a time.

When the mechanism changes, only the top layer is rewritten.

4What This Looks Like in Practice

Consider an organisation with 60 services: 15 written on WebFlux, 30 with CompletableFuture chains, 15 blocking on platform threads. A bet in line with these principles would be to make blocking code on virtual threads the default for new services and for endpoints that are being changed anyway, while leaving working reactive services alone unless they are rewritten for other reasons.

Shared clients would offer a blocking API first, with a CompletionStage variant for existing async callers. Fan-out would go through one small internal helper, built on virtual threads today and switched to structured concurrency once it is final in the JDK we run, so dozens of call sites change in one place. We would measure the outcome in terms that matter to the organisation: time to onboard an engineer onto a service, time to diagnose incidents, and p99 latency under load, which should stay the same or improve.

Notice what we do not do: a big-bang rewrite of all reactive code. That would spend years of effort to replace code that works, and would itself be a large bet on the newest style. Moving opportunistically keeps the risk small and lets us learn from the first services before converting more.

5Follow-up questions

Isn't betting on virtual threads just another fashion?

The difference is that virtual threads are part of the platform and are designed to run existing blocking code unchanged. If they ever disappoint, the code written for them is plain sequential Java that runs on platform threads too. That makes the bet cheap to reverse, unlike a style that requires rewriting code into a framework's vocabulary.

When would you still choose reactive for a new service?

When the service is fundamentally about streams: pushing events to many clients, consuming a high-volume topic into a slower sink with backpressure, or composing long-lived data flows. There the operators and backpressure are the point, not a workaround.

How do you convince teams with large reactive codebases?

By not asking them to rewrite working code. Explain the principles, show the measured results from services that moved, keep their services supported, and let them adopt the default for new work. Pressure to rewrite tends to create resistance; good results in neighbouring teams create pull.

6Conclusion

In this answer, we saw that each step from Future to CompletableFuture to reactive libraries fixed the previous pain while adding a new cost, mostly to work around expensive threads, and that virtual threads let ordinary sequential code scale again. The lesson is that bets keeping code simple and close to the platform outlast framework-specific styles. We keep concurrency mechanisms thin and at the edges, use specialised tools like reactive streams only where they add something real, and migrate opportunistically, so the next change does not require rewriting business logic.

What to say in the interviewAbout 90 seconds aloud

Open with

I read the sequence as a series of workarounds for one constraint, expensive platform threads. Future in Java 5 gave us a result from another thread but no composition, so we blocked on get.

Then, if they want more

CompletableFuture in Java 8 added composition, but logic got split into callbacks with wrapped exceptions and lost context. Reactive libraries, with Flow in Java 9, added streaming and backpressure, but at a steep learning and debugging cost, with their own operators and error model.

Then virtual threads in Java 21 removed the constraint itself: ordinary sequential code now scales, which matches how most engineers think and works with the tools they already know. Structured concurrency, still preview, adds scoped fan-out to that style.

The pattern I take from it is that bets which keep code simple and close to the platform last longer than framework-specific styles, because they benefit when the JDK improves and they are cheap to reverse.

So in an organisation I would make blocking code on virtual threads the default for new work, keep reactive only where streaming or backpressure justify it, and keep concurrency mechanisms thin and at the edges, in clients and a fan-out helper, with plain values in business logic.

Then when the next change comes, like structured concurrency becoming final, we change the helper, not the business code.

About this answer

Last updated
12 November 2026
Versions it names
Java 21, Java 25, Java 5, Java 8
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 "Java went from Future (5) to CompletableFuture (8) to Flow and reactive libraries (9 and...": https://scrivio-interview-library.netlify.app/java/completable-future/c98fa2fbcb/