High-Performance Java Persistence Newsletter, Issue 13

Imagine having a tool that can automatically detect if you are using JPA and Hibernate properly. Hypersistence Optimizer is that tool!

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 from Java.

Articles

The pick of this newsletter is this article written on the Persona’s blog about identifying long-running MySQL queries using either the Percona Monitoring and Management
tool
or the MySQL Slow Query Log.

The only constant in software is change, and database schemas are no different. To migrate the database schema from one version to another, you are better off using incremental migration scripts that are applied automatically by migration tool, like Flyway. This article explains in great detail how Flyway works and why you should definitely use it.

As I already explained, adding a query timeout threshold is a very good idea since it allows you to roll back long-running transactions that could hurt application performance by preventing the VACCUM process from cleaning up dead tuples or lowering the transaction identifier to prevent a fatal wraparound. If you are using PostgreSQL, then this article explains how to configure the query timeout threshold using the statement_timeout PostgreSQL configuration.

The Hibernate Types project allows you to map JSON column types to a great variety of JPA entity attribute types, like POJO, String, JsonNode or Map. If you want to store JSON data as a Java Map, this article explains how easily you can achieve this goal using the Hibernate Types open-source project.

Many software developers are familiar with the B+Tree database indexes. However, PostgreSQL supports many other indexing options, like Hash, Gist, Gin, BRIN. For more details about this topic, check out this article.

YouTube Video

I added a new YouTube video about speeding up integration tests using Docker and tmpfs. This video episode is part of my High-Performance Java Persistence video course, so if you like the video, you are going to love the video course even more.

Workshop Recording

The online workshop I gave about The best way to map entities with JPA and Hibernate has been recorded and is available on Teachable.

This online workshop will help you understand what you need o take into consideration when designing your JPA ad Hibernate entities so that your application works as fast as possible.

Project Releases

Hibernate ORM 5.4.18 has been released. This release fixes a security issue, so, if you are using Hibernate 5.4, you should definitely upgrade your dependency.

MariaDB 10.5 has been released, adding support for a new ColumnStore, INET 6 column types, JSON_ARRAYAGG and JSON_OBJECTAGG functions, and improving the performance of the InnoDB engine.

If you like this newsletter,

you are going to love the next episodes!

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.