High-Performance Java Persistence Newsletter, Issue 10

Imagine having a tool that can automatically detect JPA and Hibernate performance issues. Wouldn’t that be just awesome?

Well, Hypersistence Optimizer is that tool! And it works with Spring Boot, Spring Framework, Jakarta EE, Java EE, Quarkus, or Play Framework.

So, enjoy spending your time on the things you love rather than fixing performance issues in your production system on a Saturday night!

Introduction

Welcome to a new issue of the High-Performance Java Persistence Newsletter in which we share articles, videos, workshops, and StackOverflow answers that are very relevant to any developer who interacts with a database system using Java.

Articles

The pick of this edition is this amazing PostgreSQL internals list of resources written by Hironobu Suzuki. Although the PostgreSQL documentation is one of the best on the market, Hironobu Suzuki’s articles provide lots of details that had aren’t covered by the official manual.

A JPA entity needs to define an identifier attribute, whose value can be assigned either manually by the application or generated automatically by the JPA provider. To generate identifier values automatically, you have multiple options. You can use an IDENTITY column, o database sequence object. Since many relational database systems offer both IDENTITY columns and database sequences, it’s important to know which one works better with JPA and Hibernate. For more details about this topic, check out this article.

MUX published a very good article about using ClickHouse for analytics queries instead of the PostgreSQL extension offered by Citus.

PostgreSQL has been offering a JSON column type for a very long time, and this storage option is very useful when you need to store unstructured data coming from external systems. If you want to learn more about PostgreSQL JSON queries, check out this article.

JPA and Hibernate make it very easy to fetch graphs of entities via JPQL. However, if you want to fetch a read-only projection, you are better off using DTO projections. If the SQL projection contains a one-to-many relationship, then you can transform the tabular-based result set into a graph of DTOs using the Hibernate ResultTransformer. If you want to learn more about this topic, check out this article.

If you are moving from Oracle to PostgreSQL or the other way around, you might bump into all sorts of issues caused by database-specific features that are not supported by both of these two relational database systems. This article helps you find these differences and what alternatives you can use for some database-specific features.

Project releases

I managed to release the 2.9.10 version of the amazing Hibernate Types project. If you’re using Hibernate, you should definitely use Hibernate Types as well.

Hibernate ORM 5.4.16 has been released. For more details about this version, check out the release notes.

Spring Data Neumann has been released. One of the most important changes is the inclusion of Spring Data R2DBC (which allows you to build reactive applications using relational database systems) in the main Spring Data release train.

Get in touch with my latest articles!

StackOverflow Answers

The following StackOverflow answers have been trending over the past two weeks:

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.