Scrivio Interview library
LeadershipAdvanced5 min read · updated 12 November 2026

Would you allow R2DBC as a standard data access option across the organisation? What would you compare it with?

I would allow R2DBC, but as a justified option rather than a default. The main comparison is JDBC on virtual threads, which now gives high concurrency with mature drivers, JPA and familiar tooling; R2DBC earns its place in services that are fully reactive end to end or that stream large results with backpressure. Because driver maturity and observability vary by database and mixing JPA with R2DBC in one service complicates transactions, each use should come with a written rationale and a platform team that supports it.

Why this question is asked

A standard data access option is a long commitment. Once twenty teams build on it, the organisation owns its drivers, its upgrade path, its debugging skills and its hiring profile for years. So the question is less about whether R2DBC works, which it does, and more about what it costs the organisation compared with the alternatives. Interviewers ask senior candidates this to see whether they can frame a technology decision around evidence and trade-offs rather than enthusiasm. In this answer, we will recap what R2DBC promises, compare it with JDBC plus virtual threads, look at the risks that decide the matter, and finish with the policy I would write.

1A Quick Recap: What R2DBC Was Meant to Solve

R2DBC is a non-blocking SPI for relational databases. Its promise is that a service can keep thousands of queries in flight without holding a thread for each one, because the driver returns a publisher at once and delivers rows later. That mattered a great deal when the only alternative was JDBC on platform threads, each costing memory and limited to a few hundred per instance. A WebFlux service that called JDBC either blocked its event loops or pushed every query onto a large thread pool, which removed the point of being reactive.

So R2DBC solved a real problem: relational access for reactive services. The question for a standard is whether that problem is still the one most of our teams have.

2The Main Alternative: JDBC on Virtual Threads

Since Java 21, virtual threads change the picture. A virtual thread is a lightweight thread managed by the JVM; when it blocks on I/O, the JVM unmounts it from its carrier thread, so a blocked virtual thread costs little memory and no CPU. A Spring MVC service with spring.threads.virtual.enabled=true can have thousands of requests waiting on JDBC at once, with plain imperative code, JPA or Spring Data JDBC, and the drivers, profilers and debuggers everyone already knows.

That covers the most common reason teams chose R2DBC: high concurrency on a modest number of threads. What it does not cover is a service that is reactive for other reasons, such as streaming results to clients with backpressure, combining many asynchronous sources, or being part of a WebFlux codebase where blocking calls would be a foreign body. Those are the places R2DBC still fits naturally.

R2DBC compared with JDBC on virtual threads
ConcernR2DBCJDBC + virtual threads
Concurrencyhigh, few threadshigh, cheap threads
Programming modelMono and Flux everywhereplain imperative code
ORM supportsimple mapping onlyJPA, Hibernate, Spring Data JDBC
Driver maturityvaries by databasedecades of production use
Streaming with backpressurenativepossible, more manual
Tooling and debuggingharder, async stacksordinary stack traces
Hiring and onboardingsmaller pool of experiencemost Java developers

3The Risks That Decide It

Three risks matter more than raw performance. First, driver maturity, feature coverage and observability vary by database. The PostgreSQL driver is widely used; others may lag in features such as specific types, batching or stored procedures, and metrics and tracing for R2DBC pools are less complete than for HikariCP. A standard must say which databases are supported, and the platform team must test them.

Second, mixing JPA and R2DBC in one service complicates transactions. They use different transaction managers and different connections, so a method cannot update one table through JPA and another through R2DBC atomically. Teams that start with R2DBC and later add a JPA module for reporting discover this in production, as inconsistent data after a partial failure. The standard should say: one data access stack per service.

Third, the people cost. Reactive code is harder to read, test and debug; stack traces show operator internals; a forgotten subscribe silently drops a write. Every team that adopts R2DBC needs people who are good at this, and on-call engineers who can read it at 3 a.m.

4The Policy I Would Write

I would make R2DBC an allowed option, not the default. The default for new relational services would be Spring MVC with JDBC on virtual threads, because it gives most teams the concurrency they need with the lowest learning and operating cost. A team may choose R2DBC when the service is reactive end to end, for example a WebFlux gateway or a streaming API, and it writes a short decision record explaining why: the workload, the expected concurrency, the database and the reason virtual threads are not enough.

The platform team would support it properly: a shared starter with pool settings, metrics and tracing wired in, a list of supported databases and driver versions, BlockHound in the test template, and a review of each decision record. Without that support, every R2DBC team solves the same problems alone. And I would revisit the policy each year with data: incident counts, onboarding time and benchmark results for both stacks on our own workloads.

Step throughChoosing data access for a new service
  1. Is the service reactive end to end?WebFlux, streaming, async composition
    YesConsider R2DBCNoUse JDBC with virtual threads
  2. Is the database driver on the supported list?
    YesWrite a decision recordNoUse JDBC, or ask the platform team
  3. Platform review of the recordworkload, concurrency, rationale
  4. Use the shared R2DBC starterpool, metrics, tracing, BlockHound

4 steps in order. Play them, or step through them one at a time.

5Follow-up questions

Would you ever make R2DBC the default?

Only if most of our services were already fully reactive and the supported databases had mature drivers. In that organisation, forcing JDBC into WebFlux services would be worse than R2DBC. For a typical organisation with mostly request-response services, virtual threads make JDBC the cheaper default.

What would make you withdraw the option?

Evidence that R2DBC services cost much more to run than their benefits justify: more data-related incidents, longer recovery, or a driver that stops being maintained. If that appears, I would stop approving new R2DBC services and leave stable existing ones alone rather than force rewrites.

How do you stop a team from mixing JPA and R2DBC later?

By writing it into the decision record and the starter. An architecture test with ArchUnit can fail the build if both jakarta.persistence and Spring Data R2DBC are used in one module, and code review checklists ask about it. If a reactive service truly needs reporting queries, those can go to a separate service or a read replica accessed in its own way.

6Conclusion

In this answer, we treated the question as a standards decision. We recapped that R2DBC solved relational access for reactive services, compared it with JDBC on virtual threads, which now gives high concurrency with mature drivers and tooling, and identified the risks that decide it: uneven driver maturity and observability, transaction problems when JPA and R2DBC are mixed, and the people cost of reactive code. The resulting policy allows R2DBC for fully reactive or streaming services, with a written rationale and platform support, while JDBC with virtual threads stays the default.

What to say in the interviewAbout 80 seconds aloud

Open with

I would allow it, but not as the default. The comparison I care about most is JDBC on virtual threads. Since Java 21, a Spring MVC service with virtual threads can have thousands of requests waiting on JDBC with ordinary code, JPA, mature drivers and normal stack traces, which covers the main reason teams picked R2DBC, high concurrency on few threads.

Then, if they want more

R2DBC still fits well in services that are reactive end to end, like a WebFlux gateway or an API that streams large results with backpressure. Then I look at risks. Driver maturity, features and observability differ by database, so the standard has to name supported databases and driver versions.

Mixing JPA and R2DBC in one service breaks transactional consistency because they use different transaction managers and connections, so I would require one data stack per service. And reactive code costs more to learn, test and debug.

So my policy would be: JDBC with virtual threads is the default; R2DBC is allowed with a short decision record explaining the workload and why virtual threads are not enough; and a platform team owns a starter with pool settings, metrics, tracing and BlockHound in tests. I would revisit it yearly with incident and onboarding data from our own services.

About this answer

Last updated
12 November 2026
Versions it names
Java 21
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 "Would you allow R2DBC as a standard data access option across the organisation? What...": https://scrivio-interview-library.netlify.app/spring-boot/webflux/6038c6d70f/