Cover Image for The best way to fetch multiple to-many relationships with Java
Cover Image for The best way to fetch multiple to-many relationships with Java
Avatar for Virtual Java User Group
A global Java community delivering world-class Java talks for developers, everywhere.
105 Going

The best way to fetch multiple to-many relationships with Java

YouTube
Registration
Welcome! To join the event, please register below.
About Event

Fetching a multi-level hierarchy from a relational database is a classic performance bottleneck. If you do it wrong, you end up with the dreaded N+1 query problem or a Cartesian Product that brings your application to its knees.

In this session, Java Champion Vlad Mihalcea dives deep into the most efficient strategies for retrieving complex data structures—specifically for scenarios where you need to store that result set in a cache like Redis.

Date: 14 May 2026
Timing:

  • ​5:00 PM (UTC): Live stream kicks off

  • ​5:10 PM (UTC): The best way to fetch multiple to-many relationships with Java by Vlad Mihalcea

  • 6:00 PM (UTC): That’s a wrap, live stream ends


In this talk, we're going to analyze the best way we can fetch a multi-level hierarchy from an RDBMS so that we can store the result set in a cache, such as Redis.

I'm going to go through various solutions and analyze the performance impact of each option. From plain JDBC to JdbcTemplate, Spring Data JDBC, Spring Data JPA, and Blaze Persistence.

Therefore, we are going to compare how all these options work and conclude what is the most efficient way to fetch a multi-level hierarchical structure with the most common Java data access technologies.

Vlad Mihalcea, Author, Database performance tuning aficionado, Java Champion

Vlad is a Java Champion, creator of Hypersistence Optimizer (https://vladmihalcea.com/hypersistence-optimizer/) and Hypersistence Utils OSS project (https://github.com/vladmihalcea/hypersistence-utils).

He is passionate about communities, technical leadership, system architecture, and database systems.

He wrote hundreds of articles about Java, JPA, Hibernate, and SQL on his blog (https://vladmihalcea.com), and he is the author of the High-Performance Java Persistence book and video course series.

Avatar for Virtual Java User Group
A global Java community delivering world-class Java talks for developers, everywhere.
105 Going