Skip to content
Bluetape4k docs1.11

R2DBC ecosystem path

Latest stable Based on Bluetape4k release 1.11.0

Start by understanding connection and transaction boundaries, then add helpers, coroutine CRUD, or a table DSL only when repeated problems justify them.

LevelChoiceWhat it teaches and solves
1Spring DatabaseClientPublisher execution, parameter binding, driver failures, and transaction context
2bluetape4k-r2dbcKotlin mapping, CRUD helpers, pool DSL, suspend transactions, and dynamic queries
3bluetape4k-spring-boot-r2dbcCoroutine CRUD and Flow repository patterns for R2dbcEntityOperations
4bluetape4k-exposedExposed table/column DSL, coroutine repositories, caches, and Spring/Ktor integration
5Exposed R2DBC WorkshopDDL/DML, transactions, WebFlux, multi-tenancy, routing, and production integration

Higher levels do not erase the lower ones. They still run on an R2DBC driver, connection factory, and transaction boundary, so lower-level knowledge remains part of diagnosis.

Choose bluetape4k-spring-boot-r2dbc when the application keeps Spring Data entity operations but wants consistent suspend and Flow APIs for find, select, insert, update, delete, and count.

Consider Exposed R2DBC when table and column names repeat across queries, joins and dynamic predicates need a Kotlin DSL, repository rules and cache decorators should be shared, or Spring WebFlux and Ktor should use the same coroutine-native persistence model. Add only the required Exposed modules and align them through the central bluetape4k-dependencies BOM.

bluetape4k-jdbc remains appropriate for blocking services, batch work, existing JDBC tooling, and small vendor-SQL adapters. Choose R2DBC for a supported non-blocking driver and execution model, not merely because the caller uses coroutine syntax.

QuestionJDBC signalR2DBC signal
Existing assetsJDBC drivers and toolingVerified R2DBC driver and framework support
Call modelBlocking service or batchWebFlux/Ktor coroutines with high concurrent I/O
Persistence layerJDBC/JPA ecosystemSpring R2DBC or Exposed R2DBC
Operational focusThreads and connection poolConnection pool, publisher cancellation, pending acquire

The Exposed R2DBC Workshop proceeds through SQL DSL basics, connections and DDL, DML and transactions, coroutines and Flow, Spring repositories, multi-tenancy and routing, and production integration. Run the chapter tests with H2 first, then expand to PostgreSQL and MySQL Testcontainers paths.