Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017ic4b4VQVEJWetTT1dYzyJ
r2dbc
Companion code for the ankurm.com post Reactive Data Access with Spring Data R2DBC: CRUD, Transactions and When to Choose It.
Spring Boot 4.1.2, JDK 25, Spring Data R2DBC, r2dbc-postgresql 1.1.3.RELEASE, PostgreSQL 17 (Testcontainers 2.0.5).
What is in here
Customer,PurchaseOrder,Account: plain records, one row each. No relationship mapping.CustomerRepository:ReactiveCrudRepository, derived queries,@Query,@Modifying.CustomerOrderService: three ways to load customers with orders (1+N, two queries, one JOIN withDatabaseClient).AccountService:@TransactionalandTransactionalOperator, with rollback on error.schema.sql: run by Spring Boot through the R2DBC connection at startup.- Tests use
StepVerifierand write the transcripts inoutput/.
Run
cd r2dbc
./scripts/run-all.sh # needs Docker; regenerates output/*.txt
output/07-throughput-indicative.txt is an indicative JDBC vs R2DBC run on a shared 2-vCPU sandbox.
Treat it as a harness, not a result: run it on your own hardware.