R2DBC (Reactive Relational Database Connectivity) is an endeavor to bring a reactive programming API to SQL databases. It was first announced at SpringOne Platform 2018, as shown in the keynote below:
In a Nutshell
- Reactive Streams – R2DBC is founded on Reactive Streams providing a fully reactive non-blocking API.
- Relational Databases – R2DBC engages SQL databases with a reactive API, something not possible with the blocking nature of JDBC.
- Scalable Solutions – Reactive Streams makes it possible to move from the classic one thread per connection approach to a more powerful, more scalable approach.
|Feature Matrix||H2 (in-memory)||PostgreSQL||MS SQL Server||MySQL (Jasync-SQL)|
|Broad type conversion||X||X||X||X|
|URI-based implement selection||X||X||X||X|
|Observability||Through R2DBC Proxy||Through R2DBC Proxy||Through R2DBC Proxy||Through R2DBC Proxy|
Provided through the reactive connection pool implementation in
Relational meets Reactive
People wanting to scale while retaining usage of relational databases are cut off from reactive programming due to existing standards based on blocking I/O. R2DBC specifies a new API that allows reactive code that work efficiently with relational databases.
R2DBC is a specification designed from the ground up for reactive programming with SQL databases defining a non-blocking SPI for database driver implementors and client library authors. R2DBC drivers implement fully the database wire protocol on top of a non-blocking I/O layer.
R2DBC aims for a minimal SPI surface specifying only parts that differ across databases. It is fully reactive and backpressure-aware all the way down to the database. It is intended primarily as driver SPI to be consumed by client libraries and not intended to be used directly from application code.
R2DBC supports cloud native apps where relational databases like PostgreSQL, MySQL, and others are found. Have the freedom to pick the right one for the job and not be confined by API.
While led by members of the Spring team at Pivotal, R2DBC depends upon community support. Contributors from all relational data stores are invited to participate in building a reactive, relational future.