Barry Zhong
Barry Zhong

Reputation: 570

After Reactive Streams Specification 1.0 released, will jdbc specification go reactive as well?

I was learning and using reactive streams programming with akka streams, I was trying to find any libraries for an async-jdbc-driver or reactive-jdbc-driver for 2 years, and I found slick 3.0 or rxjava-jdbc-driver provide async jdbc api, but I know slick is building the amazing api on top of JDBC api, which is blocking (correct me if I am wrong), so I guess from system perspective, it may not be 100% reactive system from top to bottom.

Another amazing event was that last year 'Reactive Streams Specification V1.0' was released, so my questions are:

  1. Will the event trigger JDBC Expert Group to design async JDBC API support?
  2. And then Database Provider Organizations, such as MySQL's provider Oracle, is there any plan to implement corresponding drivers?
  3. If this is hopeless, any directions or replacement or anything I could turn into or JDBC layer does not have to be reactive and scale-out mysql servers is good enough?

Upvotes: 3

Views: 1679

Answers (2)

dazito
dazito

Reputation: 7980

According to Oracle, they are in the work of providing a non blocking API for JDBC.

As stated in the link:

This new API is completely nonblocking. It is not intended to be an extension to, or a replacement for, JDBC but, rather, an entirely separate API that provides completely nonblocking access to the same databases as JDBC.

You can now download the new API from OpenJDK and get involved with the project by reviewing the API and providing feedback on the JDBC mailing list

Upvotes: 1

akarnokd
akarnokd

Reputation: 70007

I'm not aware of any plans either. Many NoSQL solutions, who are not bound by the old JDBC API, started providing reactive-based APIs. Whether or not those are full stack reactive I can't say; you should confirm that by looking at their spec/implementation.

As we have full stack reactive solutions for TCP/HTTP via RxNetty (Retrofit, OkHttp?) and there are movements for Servlet 4.0 as well, it would be great we could just compose over an async JDBC source. However, that requires a new API design from ground up.

Perhaps once JDK 9 and is Flow API (which is essentially Reactive-Streams but under a different package) is understood and embraced among the JDK developers. Note though that it is likely the plain Reactive-Streams API might not be completely adequate for such I/O and a more expanded API is required in the form of bidirectional reactive streams.

Maybe someone with JEP experience could pick up the issue and we can start iterating on the approaches.

Until then, we have the blocking wrappers around JDBC you mentioned.

Upvotes: 2

Related Questions