Hibernate Reactive is a reactive API for Hibernate ORM, supporting non-blocking database drivers and a reactive styleof interaction with the database.
Hibernate Reactive is intended for use in a reactive programming environment likeVert.x orQuarkus, where interaction with the database should occur in a non-blocking fashion.Persistence operations are orchestrated via the construction of a reactive stream rather than via direct invocationof synchronous functions in procedural Java code.
JDBC, JPA and Hibernate ORM use blocking IO for interaction with the database, and are therefore not appropriate foruse in a reactive environment. Hibernate Reactive is a feature-rich ORM implementation designed to take advantage ofnon-blocking database clients.
Hibernate Reactive works with the Vert.x reactive database clients for:
If you already know Hibernate ORM, most of what you know applies just as well to Hibernate Reactive.And if you have existing entities and O/R mappings, they’ll mostly just work without any changes.
It’s completely possible to use Hibernate Reactive and Hibernate ORM side-by-side in the same program,sharing the same entities.
CompletionStageHibernate Reactive offers two separate APIs, one based onCompletionStage fromjava.util.concurrent,and one onUni fromMutiny.
If you already have experience programming reactive streams, it’s easy toget started.If you don’t, well, we’d better warn that reactive does take some getting used to.
Hibernate Reactive doesn’t use JDBC, and the Vert.x clients don’t depend on any JDBC driver.
Hibernate Reactive is a critical link in the reactive programming model of Quarkus.The Quarkus site has information aboutUsing Hibernate Reactive.