Hibernate performance tuning tips

Introduction In this article, I’m going to summarise the most common Hibernate performance tuning tips that can help you speed up your data access layer. While getting started with JPA and Hibernate is fairly easy, if you want to get the most out of your data access layer, it’s very important to understand how the JPA provider works, as well as the configuration properties that can help you optimize application performance.

9 High-Performance Tips when using PostgreSQL with JPA and Hibernate

Introduction To get the most out of the relational database in use, you need to make sure the data access layer resonates with the underlying database system. In this article, we are going to see what you can do to boost up performance when using PostgreSQL with JPA and Hibernate.

A beginner’s guide to the high-performance-java-persistence GitHub repository

Introduction When I started writing High-Performance Java Persistence, I realized I needed a GitHub repository to host all the test cases I needed for the code snippets in my book, and that’s how the high-performance-java-persistence GitHub repository was born. The high-performance-java-persistence GitHub repository is a collection of integration tests and utilities so that you can test JDBC, JPA, Hibernate and jOOQ features with the utmost ease.

How to run integration tests at warp speed using Docker and tmpfs

Introduction In this article, I’m going to show you how to run integration tests on PostgreSQL, MySQL, MariaDB 20 times faster using Docker and mapping the data folder on tmpfs. As previously explained, you can run database integration tests 20 times faster! The trick is to map the data directory in memory, and my previous article showed you what changes you need to do when you have a PostgreSQL or MySQL instance on your machine. In this post, I’m going to expand the original idea, and show you how you can achieve… Read More

The print version of High-Performance Java Persistence

One year after I published the first part of the High-Performance Java Persistence, I managed to publish the print version of the book. The book is printed on demand using Amazon CreateSpace, and it looks like as follows.

The best way to map a @OneToOne relationship with JPA and Hibernate

Introduction In this article, we are going to learn the best way to map a OneToOne association with JPA and Hibernate. While there are many ways you can map a one-to-one relationship with Hibernate, I’m going to demonstrate which mapping is the most efficient one from a database perspective.

14 High-Performance Java Persistence Tips

Introduction In this article, I’m going to show you various high-performance Java Persistence optimization tips that will help you get the most out of your data access layer. A high-performance data access layer requires a lot of knowledge about database internals, JDBC, JPA, Hibernate, and this post summarizes some of the most important techniques you can use to optimize your enterprise application. 1. SQL statement logging If you’re using a framework that generates statements on your behalf, you should always validate the effectiveness and efficiency of each executed statement. A testing-time assertion… Read More

High-Performance Java Persistence – Part Two

Another milestone has been reached The second part of High-Performance Java Persistence book is out. It’s been almost a year since I started writing this book, and seven months since I published the first part.

High-Performance Java Persistence – Chapter 16 – Caching

Part 2, Chapter 16 Every new chapter of my book is released right after it’s being completed, so the reader doesn’t have to wait for the whole part to be finished to get access to new material. Table of content This chapter explains how enterprise caching works, from database internal buffers, to application-level caching, and the second-level cache offered by Hibernate.

How to run database integration tests 20 times faster

Introduction In-memory databases such as H2, HSQLDB, and Derby are great to speed up integration tests. Although most database queries can be run against these in-memory databases, many enterprise systems make use of complex native queries which can only be tested against an actual production-like relational database. In this post, I’m going to show you how you can run PostgreSQL and MySQL integration tests almost as fast as any in-memory database.