High-Performance Java Persistence Newsletter, Issue 34
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 which provides 10 tips you could use to improve your SQL queries. Although the article was written for PostgreSQL, the list is very useful for other databases as well.
One of the best Twitter threads I’ve read lately is this one by the Shopify Engineering team, which unravels the massive scaling capabilities of their modular monolith architecture. I enjoyed this thread because it shows that any well-thought architecture can scale way beyond what many would believe it’s possible. For instance, their MySQL database scaled to 11 million queries per second, which delivered 11 TB per second of read I/O. Amazing, right?
Another very useful article is this one which shows you how PostgreSQL table inheritance works and when it’s useful to use it.
If you are using PostgreSQL and want to learn more about its indexing capabilities, then check out this free online course provided by Percona.
It’s common knowledge that we should avoid using fetching all columns using the *
wildcard. However, if you want a deep dive analysis into why you should avoid the *
wildcard, then you should read this article written by Tanel Põder. So, for performance reasons, you should use custom projections that fetch only the data that’s needed by the associated business logic.
Best Tweets
Here are the best tweets I posted since the last newsletter:
Code review in a nutshell pic.twitter.com/r6kKfqiuEB
— Vlad Mihalcea (@vlad_mihalcea) December 5, 2021
17 years of software development taught me three very important lessons;
— Vlad Mihalcea (@vlad_mihalcea) December 18, 2021
1️⃣ Unit and integration tests are the best way to prevent bugs.
2️⃣ Keep it simple! Remove anything that's not strictly required.
3️⃣ Question everything! From requirements to cargo cult tech trends.
Shopify uses a monolith architecture built with Ruby on Rails and MySQL.
— Vlad Mihalcea (@vlad_mihalcea) December 4, 2021
And, it scales to traffic volumes that most of the projects we are usually building will never even dream of getting 5% of that load. https://t.co/SppIGF2TRQ
The best way to log SQL statements with Spring Boothttps://t.co/23aHhyjBEv pic.twitter.com/VmVPO6Sooi
— Vlad Mihalcea (@vlad_mihalcea) December 8, 2021
It's just artificial intelligence pic.twitter.com/aoQqEZYQ6a
— Vlad Mihalcea (@vlad_mihalcea) December 16, 2021
Project Releases
Microsoft released version 9.4.1 of the SQL Server JDBC Driver fixing 2 issues.
The Hibernate team released several versions of their popular data access frameworks:
- Hibernate ORM 6.0.0.Beta3, which could be the last beta version of the 6.0 branch. We are definitely very excited about this new branch since it brings many enhancements to the most popular Java data access framework.
- Hibernate ORM 5.6.2 changes the default CLOB type for PostgreSQL, from
text
tooid
. - Hibernate Reactive 1.1.1 provides support for Hibernate ORM 5.6.2 and upgrades the reactive driver dependencies.

Get in touch with my latest articles!
StackOverflow Answers
The following StackOverflow answers have been trending over the past two weeks:
- How to create a JPA entity for a table that doesn’t have a Primary Key or Unique Key column
- Hibernate Native Query bad Performance and struggling to convert to JQPL
- How to get a date in UTC timezone when using Hibernate
- Is there a way to use HQL with MongoDB?
- Generate a non-Primary Key column value, not starting from 1, with JPA or Hibernate