Skip to content

Commit de26753

Browse files
committed
Introducing Quarkus Data Blog Post Final
1 parent 7c8d154 commit de26753

3 files changed

Lines changed: 141 additions & 0 deletions

File tree

Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
---
2+
layout: post
3+
title: 'Introducing Quarkus Data: One Gateway for Data Access'
4+
date: 2026-06-15
5+
tags: extension hibernate data panache
6+
synopsis: 'Quarkus Data unifies the data access experience in Quarkus: the place to start.'
7+
author: lmolteni
8+
---
9+
:imagesdir: /assets/images/posts/introducing-quarkus-data
10+
11+
== Quarkus Data: One Gateway for Data Access
12+
13+
You might have read Stephane's https://quarkus.io/blog/hibernate-panache-next/[blog post] about Panache Next, the new version of Panache that we're currently developing, and https://quarkus.io/blog/panache-next-renamed-to-quarkus-data/[his follow-up] on the rename to Quarkus Data.
14+
This blog post is about what comes next.
15+
16+
Having discussed current database access patterns in conferences, meetings and user feedback sessions, we know that the current implementation of Panache, which we'll call Panache 1 in this blog post, is popular as a data access mechanism.
17+
But despite Panache 1's popularity, we discovered that there is some confusion on exactly what Quarkus extension to use.
18+
19+
Should a user that needs database access in a Quarkus application use the Hibernate extension, the Hibernate Reactive extension, Panache, or something else?
20+
Given that Hibernate is currently the most popular extension in Quarkus (as most applications will need persistence on the database) you might imagine that this confusion is creating some friction.
21+
22+
Try it yourself: create a Quarkus app with the CLI, then search for a database extension:
23+
24+
[source,bash]
25+
----
26+
quarkus create app myapp
27+
cd myapp
28+
quarkus extension add jpa
29+
----
30+
31+
image::extension-search-jpa.png[Searching for JPA returns 16 extensions]
32+
33+
That's a lot of results. Some of them are not obviously related, but the ones on top are misleading.
34+
And if you try searching for "database" instead, it's even worse:
35+
36+
image::extension-search-database.png[Searching for database returns even more extensions]
37+
38+
Which one do you pick?
39+
40+
== From Panache to Jakarta Data
41+
42+
This situation is admittedly confusing, but it didn't happen by accident.
43+
Every one of those extensions exists because it solves a real problem.
44+
To understand how we got here, we need to go back to the early days of Quarkus.
45+
46+
Developers wanted a simple way to avoid writing repetitive data access code: define an entity, get basic CRUD operations, and declare queries in a single place without writing similar query methods by hand.
47+
Also, users love the idea of the "repository class", a class that will hold such queries and some helpers to avoid writing code.
48+
At the time, there was no standard repository pattern for Hibernate, so the Quarkus team created Panache to fill that gap.
49+
Panache provided a repository pattern, a single place to define queries for each entity, and also offered an active record pattern to simplify data access by putting persistence methods directly on their entities.
50+
51+
Since then, the Jakarta EE ecosystem has caught up.
52+
Jakarta Data <<jd>> standardizes the repository pattern across SQL and NoSQL databases, with an annotation processor that generates implementations at compile time, including full type checking of queries and parameter bindings against your entity model.
53+
It is a top-level specification in Jakarta EE 11 that supports both Jakarta Persistence and Jakarta NoSQL <<nosql>>.
54+
55+
With Jakarta Data now standardizing what Panache pioneered, it was natural for the Quarkus team to build on it.
56+
In fact, the influence went both ways: ideas that originated in Panache, like writing partial HQL clauses that restrict a generated query rather than writing the full query from scratch, shaped the direction of the Jakarta Data specification itself.
57+
58+
== Introducing Quarkus Data
59+
60+
We then created "Quarkus Data", an umbrella project for data access in Quarkus.
61+
It groups all data access extensions we showed earlier under a single name, making it easier to find documentation and understand how the pieces fit together.
62+
This is the biggest change to data access in Quarkus since the introduction of Panache, and we believe it's a step forward for both new and existing users.
63+
64+
[NOTE]
65+
.Why "Quarkus Data" and not "Panache Next"?
66+
====
67+
The Panache name was popular with our users, but it had a discoverability problem.
68+
"Hibernate with Panache" was meant to signal a better Hibernate experience, but if you didn't already know what Panache was, the name didn't tell you.
69+
A user searching for "hibernate" or "data" would see Panache in the results, but nothing about the name suggested it was the simpler way to do repositories, active record, or CRUD.
70+
We chose "Data" because the project is built on Jakarta Data, it's self-explanatory, and it might help users migrating from Spring as they're already used to the "Data" naming.
71+
It's also an opportunity to create an umbrella that covers both SQL and NoSQL under the same name.
72+
====
73+
74+
Under the Quarkus Data umbrella, there are specific modules for different backends.
75+
The first one is **Quarkus Data Hibernate**, for relational databases.
76+
In the future, additional modules like Quarkus Data MongoDB could follow the same model for NoSQL databases.
77+
78+
== Quarkus Data Hibernate
79+
80+
Quarkus Data Hibernate is the entry point for relational database access in Quarkus.
81+
If you need to talk to a database, this is the one extension you add:
82+
83+
[source,bash]
84+
----
85+
quarkus extension add quarkus-data-hibernate
86+
----
87+
88+
Or in your `pom.xml`:
89+
90+
[source,xml]
91+
----
92+
<dependency>
93+
<groupId>io.quarkus</groupId>
94+
<artifactId>quarkus-data-hibernate</artifactId>
95+
</dependency>
96+
----
97+
98+
This single extension gives you everything you need to start with data access in your application. It's structured in a way that makes "simple things easy, and complex things possible".
99+
This means that it offers an experience that is enjoyable for newcomers of Hibernate, without limiting advanced users from using advanced features.
100+
101+
Here's a round up of the features it offers:
102+
103+
- **Active Record Pattern support**: persistence operations live directly on your entity by extending a simple class. The simplest way to get started.
104+
- **Repositories**: define a standalone repository interface annotated with `@Repository`. The Hibernate annotation processor generates the implementation at compile time, with full type checking of queries and parameters against your entity model.
105+
- **Stateless and Managed session**: Explicit lifecycles for simple cases, all the power of Hibernate managed objects when you need it.
106+
- **Reactive**: The same entity model and project work in both blocking and non-blocking modes, useful when you need to interface with reactive code.
107+
- **Raw SQL**: write native SQL queries using `@SQL` on a repository method for those cases in which writing SQL is easier. No entity mapping required.
108+
109+
[NOTE]
110+
====
111+
While Quarkus Data Hibernate is the main entry point, some features require an additional dependency to keep the default footprint small.
112+
For example, reactive support requires adding `quarkus-hibernate-reactive` explicitly.
113+
====
114+
115+
We'll publish a hands-on tutorial shortly that walks through each style with working examples, so stay tuned.
116+
117+
== What about Panache 1?
118+
119+
Panache 1 is not going away.
120+
It will remain available as an extension for existing applications, and we have no plans to remove it.
121+
122+
That said, Quarkus Data Hibernate is where all new development and investment is happening.
123+
If you're starting a new project, we'd encourage you to give it a try. We really believe it's a better experience.
124+
The extension is still experimental, so you might find some bugs. If you do, please reach out to us either on GitHub or Zulip, we always appreciate your honest feedback.
125+
126+
We are working on migration tooling to help existing Panache 1 users transition when they are ready, and we will share more details as that work progresses.
127+
128+
== Try it today
129+
130+
You can try Quarkus Data Hibernate today from Quarkus 3.37.0.
131+
It will also ship in Quarkus 4.0.
132+
133+
Give it a try and let us know what you think. Feedback is welcome on https://quarkusio.zulipchat.com/#narrow/channel/187038-dev/topic/WG.20-.20Panache.2ENext[Zulip] or via https://github.com/quarkusio/quarkus/issues[GitHub issues].
134+
135+
[bibliography]
136+
== References
137+
138+
* [[[jd]]] https://jakarta.ee/specifications/data/[Jakarta Data specification]
139+
* [[[nosql]]] https://jakarta.ee/learn/specification-guides/nosql-and-persistence-explained/[NoSQL and Persistence explained] — how Jakarta Data supports both Jakarta Persistence and Jakarta NoSQL
140+
* https://projects.eclipse.org/projects/ee4j.data/reviews/creation-review[Jakarta Data creation review] — Eclipse Foundation approval (2022)
141+
* https://www.youtube.com/watch?v=Qr7R2pLnBDM[Gavin King on repositories and annotation processing] — what made compile-time validation the turning point
286 KB
Loading
193 KB
Loading

0 commit comments

Comments
 (0)