High-Performance Java Persistence Newsletter, Issue 20
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!
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.
COBOL has been around for over 60 years, and to the day, there are more COBOL transactions executed on a per daily basis than Google searches. To celebrate this anniversary, I interviewed Adrian Tot to share his experience ad insight into COBOL past, present, and future.
While PostgreSQL requires a single
fdatasync to the WAL (Write-Ahead Log) when committing a database transaction, MySQL requires two
fsync calls, one for the Binary Log and the other one for the Redo Log. For more details about this topic and future optimizations that you can expect in MySQL, check out this article.
Talking about MySQL, if you are using the JSON column types introduced in 5.6, then you should definitely learn about the amazing
JSON_TABLE function, which allows you to transform a JSON object to a relational table. FOr more details about this feature, you should read this article.
PostgreSQL 13 added many improvements, like the index deduplication optimization, which can reduce the index size considerably. For more details about all index-related changes coming with PostgreSQL 13, you should definitely read this article.
If you are using MySQL, then you might be interested in using ProxySQL for load balancing. If you are curious about the overhead it introduces, then this article shows that the price to pay is just 25 microseconds, which is acceptable, considering all the benefits you can get in return.
If you’re using PostgreSQL, then you should surely learn how VACUUM and ANALYZE work, as these maintenance tasks are very important for a running PostgreSQL database server. If you are curious about how to configure these processes, then this article is surely going to help you achieve your goal.
JPA and Hibernate provide a first-level cache that offers application-level repeatable reads and support for automatic batching. If you are curious how the first-level cache works behind the scenes, then you should definitely read this article.
Sebastien Blanc has published a new DevNation podcast episode in which we are talking about the High-Performance Java Persistence book.
There are many social media platforms, but for me, Twitter is the one I like best. Here are the best tweets I posted since the last newsletter:
As a senior developer, you should treat junior developers as you had wanted to be treated when you first started your career.— Vlad Mihalcea (@vlad_mihalcea) October 18, 2020
You don't need a Computer Science degree to write software that's used by millions of developers.— Vlad Mihalcea (@vlad_mihalcea) October 13, 2020
If you want to become an expert in a given technology, you have to start writing about it. You'll learn way more than just reading documentation.— Vlad Mihalcea (@vlad_mihalcea) October 17, 2020
As a software developer, you can earn good money by trading your time.— Vlad Mihalcea (@vlad_mihalcea) October 26, 2020
However, if you want to build wealth, then you are better off investing your time into building valuable products and learning how to sell them.
Writing code is not very difficult. Even GPT-3 can do it.— Vlad Mihalcea (@vlad_mihalcea) October 11, 2020
What's really hard is to identify and solve real business problems. That's a valuable skill that will be in-demand even in the future.
MySQL 8.0.22 has been released, and it brings many improvements. For instance, this version improves the way bind parameters are resolved when using server-side prepared statements. A new
error_log table has been added to the
PERFORMANCE SCHEMA so that we can now query the error log entries using SQL. A very useful feature is that the Optimizer can push down predicates when building the execution plan of a Derived Table query. Another minor improvement is that we can use the
CAST .. AS YEAR syntax to transform from a date, timestamp, number, or string value. For more details about this version, check out the release notes.
Timescale DB has released the 2.0 version. TimescaleDB is an open-source database that builds on top of PostgreSQL and provides support for processing time-series data using a multi-node, petabyte-scale distributed system.
Hibernate ORM 5.4.23 has been released and provides both fixes and performance improvements. Check out the release notes for more details.
Get in touch with my latest articles!
The following StackOverflow answers have been trending over the past two weeks:
- How to fix the Hibernate
LazyInitializationException– could not initialize proxy – no Session
- How to filter an entity by multiple fields using a Spring JPA Repository?
- How to map a PostgreSQL array with Hibernate
- What is the use of the Hibernate
- How to remove child objects from a
@ManyToManyrelation with lots of children in JPA and Hibernate
- How do I limit the number of rows returned by an Oracle query after ordering?