IBM / reactive-components

Library that provide a wrapper for JDBC (Blocking API) with reactive components (Project Reactor) using Java Persistent API (Hibernate).
Apache License 2.0
23 stars 6 forks source link

Adopt Hibernate Rx or R2DBC #12

Open mp911de opened 5 years ago

mp911de commented 5 years ago

Wrapping JDBC on thread pools is asking for trouble when running applications at scale. Applying reactive programming is opting into usage of truly non-blocking components to gain massive scalability.

A thread pool gets pretty quick exhausted. A thread pool needs a strategy to deal with overflow work. Using Executors.newFixedThreadPool(…) creates a shared unbounded queue and with this approach overflow work is likely to exhaust all JVM memory for the sake of buffering Runnables.

It would make much more sense to use a truly reactive, non-blocking infrastructure. R2DBC is a standard SPI for reactive SQL database drivers. Hibernate Rx is an ongoing investigation to provide a reactive Hibernate implementation.

FcoJavierSainz commented 5 years ago

This was a short term solution for JDBC Drivers not supported in the R2DBC yet, looking forward with this ongoing efforts.