We use cookies to provide you with a better experience. By continuing to browse the site you are agreeing to our use of cookies in accordance with our Cookie Policy.
"High-Performance Java Persistence" by Vlad Mihalcea is a comprehensive resource designed to help developers and database administrators optimize data access layers, covering JDBC, JPA, and Hibernate. The material, available as a book and online training, provides actionable strategies on connection management, batching, and query optimization. For more details, visit Vlad Mihalcea's blog High-Performance Java Persistence - Vlad Mihalcea
Only select the columns and rows you absolutely need. Fetching unneeded data wastes database memory, network bandwidth, and JVM heap space.
The book includes a "cheat sheet" for popular RDBMS: High-performance Java Persistence.pdf
By implementing these strategies, developers can transform sluggish Hibernate applications into high-throughput systems.
To achieve maximum performance, your application must adhere to three foundational principles: "High-Performance Java Persistence" by Vlad Mihalcea is a
Hibernate will not create the perfect index for you automatically. Understanding that an index on (created_at) is useless for a query filtering by (status) is crucial. You must analyze your query execution plans (using EXPLAIN ANALYZE ) to ensure your database is seeking, not scanning.
Mark read-only transactions explicitly using @Transactional(readOnly = true) . This allows Hibernate to disable dirty checking, saving memory and CPU cycles, and allows routing queries to database read-replicas. 3. Batching and Bulk Operations Understanding that an index on (created_at) is useless
Use JOIN FETCH in your JPQL queries to fetch the associated collections in a single query.
hibernate.jdbc.batch_size = 50 hibernate.order_inserts = true hibernate.order_updates = true Use code with caution.
| Part | Focus | Key Topics | | :--- | :--- | :--- | | | The low-level interactions between your application and the database. | Connection management, transaction handling, batch updates, statement caching, and result set fetching. | | Part II: JPA & Hibernate | Optimizing ORM frameworks without losing their benefits. | Efficient mappings for associations, inheritance, fetching strategies (e.g., JOIN, SELECT, SUBSELECT), caching, and concurrency control. | | Part III: jOOQ | Type-safe, expressive SQL. | Leveraging jOOQ for complex queries involving window functions, common table expressions, and upsert. |
© 2026 Sanctuary Group. All rights reserved.