Why does Spring not provide reactive (non-blocking) clients for relational databases?
I've used Vert.x toolkit for creating reactive applications with support for relational DBs like MySQL and Postgres. I know Spring provides reactive support for some NoSQL DBs like Cassandra and Mongo but are they willing to provide the same for relational DBs?
java spring-data spring-webflux reactive r2dbc
add a comment |Â
I've used Vert.x toolkit for creating reactive applications with support for relational DBs like MySQL and Postgres. I know Spring provides reactive support for some NoSQL DBs like Cassandra and Mongo but are they willing to provide the same for relational DBs?
java spring-data spring-webflux reactive r2dbc
Spring WebFlux and rxjava2-jdbc by Robert B Roeser link.medium.com/6ONWHPEsKR
â uneq95
Nov 11 at 4:20
stackoverflow.com/questions/42299455/â¦
â uneq95
Nov 11 at 4:21
baeldung.com/rxjava-jdbc
â uneq95
Nov 11 at 4:22
github.com/davidmoten/rxjava2-jdbc
â uneq95
Nov 11 at 4:23
1
Asynch JDBC is still being worked on: blogs.oracle.com/java/â¦
â duffymo
Dec 5 at 18:43
add a comment |Â
I've used Vert.x toolkit for creating reactive applications with support for relational DBs like MySQL and Postgres. I know Spring provides reactive support for some NoSQL DBs like Cassandra and Mongo but are they willing to provide the same for relational DBs?
java spring-data spring-webflux reactive r2dbc
I've used Vert.x toolkit for creating reactive applications with support for relational DBs like MySQL and Postgres. I know Spring provides reactive support for some NoSQL DBs like Cassandra and Mongo but are they willing to provide the same for relational DBs?
java spring-data spring-webflux reactive r2dbc
java spring-data spring-webflux reactive r2dbc
edited Dec 5 at 18:41
mp911de
8,95021953
8,95021953
asked Nov 11 at 1:10
Mis94
9151820
9151820
Spring WebFlux and rxjava2-jdbc by Robert B Roeser link.medium.com/6ONWHPEsKR
â uneq95
Nov 11 at 4:20
stackoverflow.com/questions/42299455/â¦
â uneq95
Nov 11 at 4:21
baeldung.com/rxjava-jdbc
â uneq95
Nov 11 at 4:22
github.com/davidmoten/rxjava2-jdbc
â uneq95
Nov 11 at 4:23
1
Asynch JDBC is still being worked on: blogs.oracle.com/java/â¦
â duffymo
Dec 5 at 18:43
add a comment |Â
Spring WebFlux and rxjava2-jdbc by Robert B Roeser link.medium.com/6ONWHPEsKR
â uneq95
Nov 11 at 4:20
stackoverflow.com/questions/42299455/â¦
â uneq95
Nov 11 at 4:21
baeldung.com/rxjava-jdbc
â uneq95
Nov 11 at 4:22
github.com/davidmoten/rxjava2-jdbc
â uneq95
Nov 11 at 4:23
1
Asynch JDBC is still being worked on: blogs.oracle.com/java/â¦
â duffymo
Dec 5 at 18:43
Spring WebFlux and rxjava2-jdbc by Robert B Roeser link.medium.com/6ONWHPEsKR
â uneq95
Nov 11 at 4:20
Spring WebFlux and rxjava2-jdbc by Robert B Roeser link.medium.com/6ONWHPEsKR
â uneq95
Nov 11 at 4:20
stackoverflow.com/questions/42299455/â¦
â uneq95
Nov 11 at 4:21
stackoverflow.com/questions/42299455/â¦
â uneq95
Nov 11 at 4:21
baeldung.com/rxjava-jdbc
â uneq95
Nov 11 at 4:22
baeldung.com/rxjava-jdbc
â uneq95
Nov 11 at 4:22
github.com/davidmoten/rxjava2-jdbc
â uneq95
Nov 11 at 4:23
github.com/davidmoten/rxjava2-jdbc
â uneq95
Nov 11 at 4:23
1
1
Asynch JDBC is still being worked on: blogs.oracle.com/java/â¦
â duffymo
Dec 5 at 18:43
Asynch JDBC is still being worked on: blogs.oracle.com/java/â¦
â duffymo
Dec 5 at 18:43
add a comment |Â
2 Answers
2
active
oldest
votes
What's the idea behind the Spring Framework?
Spring Framework is a library to improve developer productivity, and so are Spring's portfolio projects such as Spring Data, Spring Security, Spring Cloud.
These projects build on top of existing APIs which are either standardized through a JSR or a JEP or on top of libraries that have proved to be useful and widely used. The Spring team does not build drivers for databases or other integrations, that's up to the database/driver vendors.
WebFlux compared to Vert.x
Spring WebFlux is an good example for a typical Spring module. It builds on top of existing non-blocking servers (Project Reactor via netty, Undertow, and Jetty). WebFlux provides a runtime container for non-blocking, reactive applications leveraging Spring components to assist in developing and running such applications.
Vert.x is an excellent example of an integrated environment that provides its own low-level implementations. Vert.x is heavily optimized and such an eco-system requires optimized integrations. Vert.x came up with own implementations for various databases and provides APIs that work well in a Vert.x context but these APIs are not JDBC.
Relational Database APIs
As M-Razavi already mentioned, Java uses JDBC to integrate with relational databases and JDBC is of a blocking nature â there's nothing sensible one could do about to mitigate the blocking nature of JDBC. Offloading JDBC calls to an Executor
(typically Thread
pool) is limited in its usefulness as the pool eventually saturates with requests). TL;DR, there's no API available on top of which we could provide a reactive relational database integration.
So what are the options?
M-Razavi already mentioned ADBA that is an initiative from Oracle to provide a standardized API for asynchronous database access in Java using futures. Everything in ADBA is still work in progress and the team behind ADBA is happy to get feedback. A bunch of Postgres folks is working on a Postgres ADBA driver that can be used for first experiments.
However, ADBA is a future goal and I expect that we don't see ADBA released with Java 12.
There are a couple of independent drivers such as Reactiverse's reactive-pg-client. These drivers come with a vendor-specific API and aren't really suited for a broader integration in Spring. We would need to provide additional layers to expose a common API, and new drivers couldn't be just plugged into your application so it works-out-of-the-boxâ¢. Having a standard API allows pluggability, so there's huge value in having a standard API.
R2DBC to the rescue?
Lacking a standard API and the non-availability of drivers, a team at Pivotal started to investigate on a reactive relational API that would be an ideal fit for reactive programming purposes. They came up with R2DBC which stands for Reactive Relational Database Connectivity. As of now, R2DBC is an incubator project to evaluate the feasibility and to start discussions whether driver vendors are interested at all in supporting reactive/non-blocking/asynchronous drivers.
As of now, there are three driver implementations:
- PostgreSQL
- H2
- Microsoft SQL Server
R2DBC comes with an API specification (r2dbc-spi
) and a client (r2dbc-client
) that makes the SPI usable for applications. We started exploring on a Spring Data R2DBC integration that provides reactive APIs through a database client and by supporting reactive repositories.
R2DBC and its eco-system are still young and ask for experiments and feedback to collect use cases and to see whether a reactive relational database integration would make sense.
Right now, you can consume R2DBC through Spring Data and the following snippet shows DatabaseClient
usage:
PostgresqlConnectionFactory connectionFactory = new PostgresqlConnectionFactory(â¦);
DatabaseClient databaseClient = DatabaseClient.create(connectionFactory);
Mono<Integer> count = databaseClient.execute()
.sql("INSERT INTO legoset (id, name, manual) VALUES($1, $2, $3)")
.bind("$1", 42055)
.bind("$2", "Description")
.bindNull("$3", Integer.class)
.fetch()
.rowsUpdated();
Flux<Map<String, Object>> rows = databaseClient.execute()
.sql("SELECT id, name, manual FROM legoset")
.fetch()
.all();
add a comment |Â
Spring WebFlux is a great way to create a non-blocking REST application. One issue that you run into when start working with WebFlux is JDBC, because JDBC is blocking. New school databases like Cassandra or Couchbase have non-blocking drivers. In CouchbaseâÂÂs case its driver uses RXJava. There is some effort going into creating asynchronous drivers for databases, as well as OracleâÂÂs effort to create ADBA. Unfortunately, these are early days, and if you want to talk to a SQL database on the JVM youâÂÂre stuck with a blocking driver.
Actually, Spring is not responsible for providing a none blocking driver for relational databases.
2
I don't know why this has been downvoted but i also have read that jdbc is blocking by its nature.
â uneq95
Nov 11 at 12:25
You are right, but I'm wondering as I mentioned other tools like Vert.x provide async clients for relational databases.
â Mis94
Nov 11 at 16:52
1
Most of the time these tools are putting lipstick on a blocking DB client (executing it in a managed thread pool that has the same size as the connection pool) and calling it reactive. see eg. stackoverflow.com/questions/50432154/â¦
â Simon Baslé
Dec 7 at 14:46
hmm...seems true, I didn't know this before.
â Mis94
Dec 8 at 19:58
add a comment |Â
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
What's the idea behind the Spring Framework?
Spring Framework is a library to improve developer productivity, and so are Spring's portfolio projects such as Spring Data, Spring Security, Spring Cloud.
These projects build on top of existing APIs which are either standardized through a JSR or a JEP or on top of libraries that have proved to be useful and widely used. The Spring team does not build drivers for databases or other integrations, that's up to the database/driver vendors.
WebFlux compared to Vert.x
Spring WebFlux is an good example for a typical Spring module. It builds on top of existing non-blocking servers (Project Reactor via netty, Undertow, and Jetty). WebFlux provides a runtime container for non-blocking, reactive applications leveraging Spring components to assist in developing and running such applications.
Vert.x is an excellent example of an integrated environment that provides its own low-level implementations. Vert.x is heavily optimized and such an eco-system requires optimized integrations. Vert.x came up with own implementations for various databases and provides APIs that work well in a Vert.x context but these APIs are not JDBC.
Relational Database APIs
As M-Razavi already mentioned, Java uses JDBC to integrate with relational databases and JDBC is of a blocking nature â there's nothing sensible one could do about to mitigate the blocking nature of JDBC. Offloading JDBC calls to an Executor
(typically Thread
pool) is limited in its usefulness as the pool eventually saturates with requests). TL;DR, there's no API available on top of which we could provide a reactive relational database integration.
So what are the options?
M-Razavi already mentioned ADBA that is an initiative from Oracle to provide a standardized API for asynchronous database access in Java using futures. Everything in ADBA is still work in progress and the team behind ADBA is happy to get feedback. A bunch of Postgres folks is working on a Postgres ADBA driver that can be used for first experiments.
However, ADBA is a future goal and I expect that we don't see ADBA released with Java 12.
There are a couple of independent drivers such as Reactiverse's reactive-pg-client. These drivers come with a vendor-specific API and aren't really suited for a broader integration in Spring. We would need to provide additional layers to expose a common API, and new drivers couldn't be just plugged into your application so it works-out-of-the-boxâ¢. Having a standard API allows pluggability, so there's huge value in having a standard API.
R2DBC to the rescue?
Lacking a standard API and the non-availability of drivers, a team at Pivotal started to investigate on a reactive relational API that would be an ideal fit for reactive programming purposes. They came up with R2DBC which stands for Reactive Relational Database Connectivity. As of now, R2DBC is an incubator project to evaluate the feasibility and to start discussions whether driver vendors are interested at all in supporting reactive/non-blocking/asynchronous drivers.
As of now, there are three driver implementations:
- PostgreSQL
- H2
- Microsoft SQL Server
R2DBC comes with an API specification (r2dbc-spi
) and a client (r2dbc-client
) that makes the SPI usable for applications. We started exploring on a Spring Data R2DBC integration that provides reactive APIs through a database client and by supporting reactive repositories.
R2DBC and its eco-system are still young and ask for experiments and feedback to collect use cases and to see whether a reactive relational database integration would make sense.
Right now, you can consume R2DBC through Spring Data and the following snippet shows DatabaseClient
usage:
PostgresqlConnectionFactory connectionFactory = new PostgresqlConnectionFactory(â¦);
DatabaseClient databaseClient = DatabaseClient.create(connectionFactory);
Mono<Integer> count = databaseClient.execute()
.sql("INSERT INTO legoset (id, name, manual) VALUES($1, $2, $3)")
.bind("$1", 42055)
.bind("$2", "Description")
.bindNull("$3", Integer.class)
.fetch()
.rowsUpdated();
Flux<Map<String, Object>> rows = databaseClient.execute()
.sql("SELECT id, name, manual FROM legoset")
.fetch()
.all();
add a comment |Â
What's the idea behind the Spring Framework?
Spring Framework is a library to improve developer productivity, and so are Spring's portfolio projects such as Spring Data, Spring Security, Spring Cloud.
These projects build on top of existing APIs which are either standardized through a JSR or a JEP or on top of libraries that have proved to be useful and widely used. The Spring team does not build drivers for databases or other integrations, that's up to the database/driver vendors.
WebFlux compared to Vert.x
Spring WebFlux is an good example for a typical Spring module. It builds on top of existing non-blocking servers (Project Reactor via netty, Undertow, and Jetty). WebFlux provides a runtime container for non-blocking, reactive applications leveraging Spring components to assist in developing and running such applications.
Vert.x is an excellent example of an integrated environment that provides its own low-level implementations. Vert.x is heavily optimized and such an eco-system requires optimized integrations. Vert.x came up with own implementations for various databases and provides APIs that work well in a Vert.x context but these APIs are not JDBC.
Relational Database APIs
As M-Razavi already mentioned, Java uses JDBC to integrate with relational databases and JDBC is of a blocking nature â there's nothing sensible one could do about to mitigate the blocking nature of JDBC. Offloading JDBC calls to an Executor
(typically Thread
pool) is limited in its usefulness as the pool eventually saturates with requests). TL;DR, there's no API available on top of which we could provide a reactive relational database integration.
So what are the options?
M-Razavi already mentioned ADBA that is an initiative from Oracle to provide a standardized API for asynchronous database access in Java using futures. Everything in ADBA is still work in progress and the team behind ADBA is happy to get feedback. A bunch of Postgres folks is working on a Postgres ADBA driver that can be used for first experiments.
However, ADBA is a future goal and I expect that we don't see ADBA released with Java 12.
There are a couple of independent drivers such as Reactiverse's reactive-pg-client. These drivers come with a vendor-specific API and aren't really suited for a broader integration in Spring. We would need to provide additional layers to expose a common API, and new drivers couldn't be just plugged into your application so it works-out-of-the-boxâ¢. Having a standard API allows pluggability, so there's huge value in having a standard API.
R2DBC to the rescue?
Lacking a standard API and the non-availability of drivers, a team at Pivotal started to investigate on a reactive relational API that would be an ideal fit for reactive programming purposes. They came up with R2DBC which stands for Reactive Relational Database Connectivity. As of now, R2DBC is an incubator project to evaluate the feasibility and to start discussions whether driver vendors are interested at all in supporting reactive/non-blocking/asynchronous drivers.
As of now, there are three driver implementations:
- PostgreSQL
- H2
- Microsoft SQL Server
R2DBC comes with an API specification (r2dbc-spi
) and a client (r2dbc-client
) that makes the SPI usable for applications. We started exploring on a Spring Data R2DBC integration that provides reactive APIs through a database client and by supporting reactive repositories.
R2DBC and its eco-system are still young and ask for experiments and feedback to collect use cases and to see whether a reactive relational database integration would make sense.
Right now, you can consume R2DBC through Spring Data and the following snippet shows DatabaseClient
usage:
PostgresqlConnectionFactory connectionFactory = new PostgresqlConnectionFactory(â¦);
DatabaseClient databaseClient = DatabaseClient.create(connectionFactory);
Mono<Integer> count = databaseClient.execute()
.sql("INSERT INTO legoset (id, name, manual) VALUES($1, $2, $3)")
.bind("$1", 42055)
.bind("$2", "Description")
.bindNull("$3", Integer.class)
.fetch()
.rowsUpdated();
Flux<Map<String, Object>> rows = databaseClient.execute()
.sql("SELECT id, name, manual FROM legoset")
.fetch()
.all();
add a comment |Â
What's the idea behind the Spring Framework?
Spring Framework is a library to improve developer productivity, and so are Spring's portfolio projects such as Spring Data, Spring Security, Spring Cloud.
These projects build on top of existing APIs which are either standardized through a JSR or a JEP or on top of libraries that have proved to be useful and widely used. The Spring team does not build drivers for databases or other integrations, that's up to the database/driver vendors.
WebFlux compared to Vert.x
Spring WebFlux is an good example for a typical Spring module. It builds on top of existing non-blocking servers (Project Reactor via netty, Undertow, and Jetty). WebFlux provides a runtime container for non-blocking, reactive applications leveraging Spring components to assist in developing and running such applications.
Vert.x is an excellent example of an integrated environment that provides its own low-level implementations. Vert.x is heavily optimized and such an eco-system requires optimized integrations. Vert.x came up with own implementations for various databases and provides APIs that work well in a Vert.x context but these APIs are not JDBC.
Relational Database APIs
As M-Razavi already mentioned, Java uses JDBC to integrate with relational databases and JDBC is of a blocking nature â there's nothing sensible one could do about to mitigate the blocking nature of JDBC. Offloading JDBC calls to an Executor
(typically Thread
pool) is limited in its usefulness as the pool eventually saturates with requests). TL;DR, there's no API available on top of which we could provide a reactive relational database integration.
So what are the options?
M-Razavi already mentioned ADBA that is an initiative from Oracle to provide a standardized API for asynchronous database access in Java using futures. Everything in ADBA is still work in progress and the team behind ADBA is happy to get feedback. A bunch of Postgres folks is working on a Postgres ADBA driver that can be used for first experiments.
However, ADBA is a future goal and I expect that we don't see ADBA released with Java 12.
There are a couple of independent drivers such as Reactiverse's reactive-pg-client. These drivers come with a vendor-specific API and aren't really suited for a broader integration in Spring. We would need to provide additional layers to expose a common API, and new drivers couldn't be just plugged into your application so it works-out-of-the-boxâ¢. Having a standard API allows pluggability, so there's huge value in having a standard API.
R2DBC to the rescue?
Lacking a standard API and the non-availability of drivers, a team at Pivotal started to investigate on a reactive relational API that would be an ideal fit for reactive programming purposes. They came up with R2DBC which stands for Reactive Relational Database Connectivity. As of now, R2DBC is an incubator project to evaluate the feasibility and to start discussions whether driver vendors are interested at all in supporting reactive/non-blocking/asynchronous drivers.
As of now, there are three driver implementations:
- PostgreSQL
- H2
- Microsoft SQL Server
R2DBC comes with an API specification (r2dbc-spi
) and a client (r2dbc-client
) that makes the SPI usable for applications. We started exploring on a Spring Data R2DBC integration that provides reactive APIs through a database client and by supporting reactive repositories.
R2DBC and its eco-system are still young and ask for experiments and feedback to collect use cases and to see whether a reactive relational database integration would make sense.
Right now, you can consume R2DBC through Spring Data and the following snippet shows DatabaseClient
usage:
PostgresqlConnectionFactory connectionFactory = new PostgresqlConnectionFactory(â¦);
DatabaseClient databaseClient = DatabaseClient.create(connectionFactory);
Mono<Integer> count = databaseClient.execute()
.sql("INSERT INTO legoset (id, name, manual) VALUES($1, $2, $3)")
.bind("$1", 42055)
.bind("$2", "Description")
.bindNull("$3", Integer.class)
.fetch()
.rowsUpdated();
Flux<Map<String, Object>> rows = databaseClient.execute()
.sql("SELECT id, name, manual FROM legoset")
.fetch()
.all();
What's the idea behind the Spring Framework?
Spring Framework is a library to improve developer productivity, and so are Spring's portfolio projects such as Spring Data, Spring Security, Spring Cloud.
These projects build on top of existing APIs which are either standardized through a JSR or a JEP or on top of libraries that have proved to be useful and widely used. The Spring team does not build drivers for databases or other integrations, that's up to the database/driver vendors.
WebFlux compared to Vert.x
Spring WebFlux is an good example for a typical Spring module. It builds on top of existing non-blocking servers (Project Reactor via netty, Undertow, and Jetty). WebFlux provides a runtime container for non-blocking, reactive applications leveraging Spring components to assist in developing and running such applications.
Vert.x is an excellent example of an integrated environment that provides its own low-level implementations. Vert.x is heavily optimized and such an eco-system requires optimized integrations. Vert.x came up with own implementations for various databases and provides APIs that work well in a Vert.x context but these APIs are not JDBC.
Relational Database APIs
As M-Razavi already mentioned, Java uses JDBC to integrate with relational databases and JDBC is of a blocking nature â there's nothing sensible one could do about to mitigate the blocking nature of JDBC. Offloading JDBC calls to an Executor
(typically Thread
pool) is limited in its usefulness as the pool eventually saturates with requests). TL;DR, there's no API available on top of which we could provide a reactive relational database integration.
So what are the options?
M-Razavi already mentioned ADBA that is an initiative from Oracle to provide a standardized API for asynchronous database access in Java using futures. Everything in ADBA is still work in progress and the team behind ADBA is happy to get feedback. A bunch of Postgres folks is working on a Postgres ADBA driver that can be used for first experiments.
However, ADBA is a future goal and I expect that we don't see ADBA released with Java 12.
There are a couple of independent drivers such as Reactiverse's reactive-pg-client. These drivers come with a vendor-specific API and aren't really suited for a broader integration in Spring. We would need to provide additional layers to expose a common API, and new drivers couldn't be just plugged into your application so it works-out-of-the-boxâ¢. Having a standard API allows pluggability, so there's huge value in having a standard API.
R2DBC to the rescue?
Lacking a standard API and the non-availability of drivers, a team at Pivotal started to investigate on a reactive relational API that would be an ideal fit for reactive programming purposes. They came up with R2DBC which stands for Reactive Relational Database Connectivity. As of now, R2DBC is an incubator project to evaluate the feasibility and to start discussions whether driver vendors are interested at all in supporting reactive/non-blocking/asynchronous drivers.
As of now, there are three driver implementations:
- PostgreSQL
- H2
- Microsoft SQL Server
R2DBC comes with an API specification (r2dbc-spi
) and a client (r2dbc-client
) that makes the SPI usable for applications. We started exploring on a Spring Data R2DBC integration that provides reactive APIs through a database client and by supporting reactive repositories.
R2DBC and its eco-system are still young and ask for experiments and feedback to collect use cases and to see whether a reactive relational database integration would make sense.
Right now, you can consume R2DBC through Spring Data and the following snippet shows DatabaseClient
usage:
PostgresqlConnectionFactory connectionFactory = new PostgresqlConnectionFactory(â¦);
DatabaseClient databaseClient = DatabaseClient.create(connectionFactory);
Mono<Integer> count = databaseClient.execute()
.sql("INSERT INTO legoset (id, name, manual) VALUES($1, $2, $3)")
.bind("$1", 42055)
.bind("$2", "Description")
.bindNull("$3", Integer.class)
.fetch()
.rowsUpdated();
Flux<Map<String, Object>> rows = databaseClient.execute()
.sql("SELECT id, name, manual FROM legoset")
.fetch()
.all();
answered Dec 5 at 18:40
mp911de
8,95021953
8,95021953
add a comment |Â
add a comment |Â
Spring WebFlux is a great way to create a non-blocking REST application. One issue that you run into when start working with WebFlux is JDBC, because JDBC is blocking. New school databases like Cassandra or Couchbase have non-blocking drivers. In CouchbaseâÂÂs case its driver uses RXJava. There is some effort going into creating asynchronous drivers for databases, as well as OracleâÂÂs effort to create ADBA. Unfortunately, these are early days, and if you want to talk to a SQL database on the JVM youâÂÂre stuck with a blocking driver.
Actually, Spring is not responsible for providing a none blocking driver for relational databases.
2
I don't know why this has been downvoted but i also have read that jdbc is blocking by its nature.
â uneq95
Nov 11 at 12:25
You are right, but I'm wondering as I mentioned other tools like Vert.x provide async clients for relational databases.
â Mis94
Nov 11 at 16:52
1
Most of the time these tools are putting lipstick on a blocking DB client (executing it in a managed thread pool that has the same size as the connection pool) and calling it reactive. see eg. stackoverflow.com/questions/50432154/â¦
â Simon Baslé
Dec 7 at 14:46
hmm...seems true, I didn't know this before.
â Mis94
Dec 8 at 19:58
add a comment |Â
Spring WebFlux is a great way to create a non-blocking REST application. One issue that you run into when start working with WebFlux is JDBC, because JDBC is blocking. New school databases like Cassandra or Couchbase have non-blocking drivers. In CouchbaseâÂÂs case its driver uses RXJava. There is some effort going into creating asynchronous drivers for databases, as well as OracleâÂÂs effort to create ADBA. Unfortunately, these are early days, and if you want to talk to a SQL database on the JVM youâÂÂre stuck with a blocking driver.
Actually, Spring is not responsible for providing a none blocking driver for relational databases.
2
I don't know why this has been downvoted but i also have read that jdbc is blocking by its nature.
â uneq95
Nov 11 at 12:25
You are right, but I'm wondering as I mentioned other tools like Vert.x provide async clients for relational databases.
â Mis94
Nov 11 at 16:52
1
Most of the time these tools are putting lipstick on a blocking DB client (executing it in a managed thread pool that has the same size as the connection pool) and calling it reactive. see eg. stackoverflow.com/questions/50432154/â¦
â Simon Baslé
Dec 7 at 14:46
hmm...seems true, I didn't know this before.
â Mis94
Dec 8 at 19:58
add a comment |Â
Spring WebFlux is a great way to create a non-blocking REST application. One issue that you run into when start working with WebFlux is JDBC, because JDBC is blocking. New school databases like Cassandra or Couchbase have non-blocking drivers. In CouchbaseâÂÂs case its driver uses RXJava. There is some effort going into creating asynchronous drivers for databases, as well as OracleâÂÂs effort to create ADBA. Unfortunately, these are early days, and if you want to talk to a SQL database on the JVM youâÂÂre stuck with a blocking driver.
Actually, Spring is not responsible for providing a none blocking driver for relational databases.
Spring WebFlux is a great way to create a non-blocking REST application. One issue that you run into when start working with WebFlux is JDBC, because JDBC is blocking. New school databases like Cassandra or Couchbase have non-blocking drivers. In CouchbaseâÂÂs case its driver uses RXJava. There is some effort going into creating asynchronous drivers for databases, as well as OracleâÂÂs effort to create ADBA. Unfortunately, these are early days, and if you want to talk to a SQL database on the JVM youâÂÂre stuck with a blocking driver.
Actually, Spring is not responsible for providing a none blocking driver for relational databases.
answered Nov 11 at 7:14
M-Razavi
1,37311731
1,37311731
2
I don't know why this has been downvoted but i also have read that jdbc is blocking by its nature.
â uneq95
Nov 11 at 12:25
You are right, but I'm wondering as I mentioned other tools like Vert.x provide async clients for relational databases.
â Mis94
Nov 11 at 16:52
1
Most of the time these tools are putting lipstick on a blocking DB client (executing it in a managed thread pool that has the same size as the connection pool) and calling it reactive. see eg. stackoverflow.com/questions/50432154/â¦
â Simon Baslé
Dec 7 at 14:46
hmm...seems true, I didn't know this before.
â Mis94
Dec 8 at 19:58
add a comment |Â
2
I don't know why this has been downvoted but i also have read that jdbc is blocking by its nature.
â uneq95
Nov 11 at 12:25
You are right, but I'm wondering as I mentioned other tools like Vert.x provide async clients for relational databases.
â Mis94
Nov 11 at 16:52
1
Most of the time these tools are putting lipstick on a blocking DB client (executing it in a managed thread pool that has the same size as the connection pool) and calling it reactive. see eg. stackoverflow.com/questions/50432154/â¦
â Simon Baslé
Dec 7 at 14:46
hmm...seems true, I didn't know this before.
â Mis94
Dec 8 at 19:58
2
2
I don't know why this has been downvoted but i also have read that jdbc is blocking by its nature.
â uneq95
Nov 11 at 12:25
I don't know why this has been downvoted but i also have read that jdbc is blocking by its nature.
â uneq95
Nov 11 at 12:25
You are right, but I'm wondering as I mentioned other tools like Vert.x provide async clients for relational databases.
â Mis94
Nov 11 at 16:52
You are right, but I'm wondering as I mentioned other tools like Vert.x provide async clients for relational databases.
â Mis94
Nov 11 at 16:52
1
1
Most of the time these tools are putting lipstick on a blocking DB client (executing it in a managed thread pool that has the same size as the connection pool) and calling it reactive. see eg. stackoverflow.com/questions/50432154/â¦
â Simon Baslé
Dec 7 at 14:46
Most of the time these tools are putting lipstick on a blocking DB client (executing it in a managed thread pool that has the same size as the connection pool) and calling it reactive. see eg. stackoverflow.com/questions/50432154/â¦
â Simon Baslé
Dec 7 at 14:46
hmm...seems true, I didn't know this before.
â Mis94
Dec 8 at 19:58
hmm...seems true, I didn't know this before.
â Mis94
Dec 8 at 19:58
add a comment |Â
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid â¦
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid â¦
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53244964%2fwhy-does-spring-not-provide-reactive-non-blocking-clients-for-relational-datab%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Spring WebFlux and rxjava2-jdbc by Robert B Roeser link.medium.com/6ONWHPEsKR
â uneq95
Nov 11 at 4:20
stackoverflow.com/questions/42299455/â¦
â uneq95
Nov 11 at 4:21
baeldung.com/rxjava-jdbc
â uneq95
Nov 11 at 4:22
github.com/davidmoten/rxjava2-jdbc
â uneq95
Nov 11 at 4:23
1
Asynch JDBC is still being worked on: blogs.oracle.com/java/â¦
â duffymo
Dec 5 at 18:43