High-Performance Java Persistence Newsletter, Issue 29
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 article from Percona that presents the new pg_stat_monitor
tool they developed to simplify PostgreSQL performance monitoring.
The pg_stat_monitor
builds on top of the existing pg_stat_statement
PostgreSQL extension and aggregates query calls into time windows, called buckets. This allows you to capture the performance statistics during traffic spikes, which would be difficult to trace with the standard pg_stat_statement
tool since it levels up short-term spikes.
When navigating large result sets using pagination, the default SQL Offset pagination is not very suitable for seeking through an associate B+Tree index. Therefore, the Keyset Pagination technique aims to fix this problem and provide a much more efficient implementation. For more details about this technique, check out this article.
If you are using PostgreSQL and want to set up a Multi-Primary replication scheme, then this article evaluates several options you could use.
If you used SQL Server and got used to the NEWSEQUENTIALID
function that allows you to generate GUID numbers that follow a sequential pattern and want to achieve the same goal in PostgreSQL, then this sequential-uuids
extension will surely help you.
If you are using JPA or Hibernate, then you should definitely use Blaze Persistence as well because it provides support for many features that are not present in JPA or Hibernate. To get an idea of its capabilities, check out this article which shows how you can use Blaze Persistence to build complex queries dynamically.
Percona PMM tool allows you to monitor and manage both MySQL and PostgreSQL database systems. To see how you can use PMM to track a performance problem, check out this article.
Best Tweets
Here are the best tweets I posted since the last newsletter:
Code reusability is what you get when you use a framework.
— Vlad Mihalcea (@vlad_mihalcea) August 1, 2021
Overengineering is what get when you spend time and resources building an in-house framework no one wanted or needed.
As software developers, we are very fortunate to be able to earn good money doing what we really enjoy.
— Vlad Mihalcea (@vlad_mihalcea) July 29, 2021
You don't need to know everything.
— Vlad Mihalcea (@vlad_mihalcea) July 11, 2021
You just need to know where to find what you don't know.
You don't need a large team to build an awesome software product.
— Vlad Mihalcea (@vlad_mihalcea) July 28, 2021
A small team of motivated developers is all you need.
When adding a library to your project, all the library problems become your problems as well.
— Vlad Mihalcea (@vlad_mihalcea) July 25, 2021
Project Releases
MySQL 8.0.26 has been released and provides many new features and bug fixes as well.
Hibernate ORM released two versions since the last newsletter episode:
The PostgreSQL JDBC Driver released two new versions:
The 2.12.1 version of the Hibernate Types project has been released and fixes one issue related to ZonedDateTime
handling.

Get in touch with my latest articles!
StackOverflow Answers
The following StackOverflow answers have been trending over the past two weeks:
- How can we set the Read Uncommitted isolation level with JPA and Hibernate?
- Is it possible to limit the size of a
@OneToMany
collection with Hibernate or JPA Annotations? - How to query with Spring JPA on
jsonb
columns? - JPA orphan removal does not work for
@OneToOne
relations - Hibernate: How to use a custom collection of
@Embeddables
? - Spring JPA Many to Many with extra column not updating