Introduction In this article, we are going to see what is the best way we can use OneToOne optional attribute so that we can avoid N+1 query issues. One-To-One table relationship As I explained in this article, in a one-to-one table relationship, the parent and the child tables s … | Continue reading
Introduction In this article, we are going to investigate how to calculate percentiles with the SQL PERCENTILE_CONT function. Domain Model Let’s consider we have the following quotes table that holds the historical price values of various stocks and indexes: The quotes table is p … | Continue reading
Introduction In this article, we are going to investigate the difference between the PostgreSQL FOR UPDATE and FOR NO KEY UPDATE when locking a parent record and inserting a child row. Domain Model To see the difference between the PostgreSQL FOR UPDATE and FOR NO KEY UPDATE lock … | Continue reading
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 week … | Continue reading
Introduction In this article, we are going to analyze how PostgreSQL Heap-Only-Tuple or HOT Update optimization works, and why you should avoid indexing columns that change very frequently. PostgreSQL Tables and Indexes Unlike SQL Server or MySQL, which store table records in a C … | Continue reading
Introduction In this article, we are going to analyze the PostgreSQL Index Types so that we can understand when to choose one index type over the other. When using a relational database system, indexing is a very important topic because it can help you speed up your SQL queries b … | Continue reading
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 week … | Continue reading
Introduction In this article, we are going to see how we can map the OffsetDateTime ZoneOffset with the Hibernate TimeZoneColumn annotation. As I explained in this article, by default, Hibernate doesn’t store the time-zone offset of an OffsetDateTime entity attribute in a separat … | Continue reading
Introduction In this article, we are going to see how we can use Java Records with Spring Data JPA Repositories. As I already explained, Java Records cannot be used as JPA entities since the Records are immutable, and JPA requires the entity class to have a default constructor an … | Continue reading
Introduction In this article, we are going to explore various PostgreSQL performance tuning settings that you might want to configure since the default values are not suitable for a QA or production environment. As explained in this PostgreSQL wiki page, the default PostgreSQL co … | Continue reading
Introduction In this article, we are going to see how we can use the Hibernate StatelessSession in order to enable JDBC Batching for INSERT, UPDATE, and DELETE statements. While the StatelessSession has been available for more than 20 years, until Hibernate 6, its usefulness was … | Continue reading
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 week … | Continue reading
Learn how a race condition led to the bankruptcy of Flexcoin in 2014 after hackers stole all the available funds. | Continue reading
Learn how you can create a tech startup. This is the real-life story of how I created RevoGain. | Continue reading
Eight years and counting! It was September 2013, and I had always wanted to start a blog but had never found the motivation to do it. If you keep on waiting for the right time to do something, that day might never come. Either you start right away, or you just keep on lying to yo … | Continue reading
60 years of COBOL, and, most likely, it's here for the future. This article is an interview with Adrian Tot about the state of COBOL. | Continue reading
Introduction All projects I’ve been working on have used database connection pooling and that’s for very good reasons. Sometimes we might forget why we are employing one design pattern or a particular technology, so it’s worth stepping back and reason on it. Every technology or t … | Continue reading
Learn what the 2PL (Two-Phase Locking) algorithm works and how it can guarantee data integrity strict serializability in a relational database system. | Continue reading
(Last Updated On: June 6, 2018)Introduction 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 … | Continue reading
(Last Updated On: January 4, 2018)Introduction In Concurrency Control theory, there are two ways you can deal with conflicts: You can avoid them, by employing a pessimistic locking mechanism (e.g. Read/Write locks, Two-Phase Locking) You can allow conflicts to occur, but you need … | Continue reading
If you are struggling with data access performance issues, then you should definitely check out these PostgreSQL performance tuning tips. | Continue reading
Learn various multitetancy strategies when using a relational database system like catalog, schema or table-based tenant isolation patterns. | Continue reading
Learn how to use the JPA @PrePersist and @PreUpdate entity event listeners on Embeddable types with Hibernate ORM 5.2.17 | Continue reading