High-Performance Spring Data JPA



Kursarrangør: Bouvet
Sted: Bouvet avd Oslo
          Oslo, Majorstua
Kursadresse: Sørkedalsveien 8, 0369 Oslo (kart)
Type:Åpent kurs / gruppeundervisning
Studie / yrkesutdanning
Undervisningstid: kl 09:00 - 16:00/17:00
Varighet: 2 dager
Pris: 16.900
Neste kurs: 24.03.2025 | Vis alle kursdatoer

Spring Data JPA is a very popular data access technology, and knowing its inner workings can make the difference between a high-performance Spring application and one that barely crawls.

In this training, we go through the most common performance bottleneck issues while providing the most effective solutions as well.

After this training, the students will know more about both Spring and database systems, so that they can better design and develop their application data-intensive applications.

Agenda

Day 1

1. Introduction - 1h 45m

• O/R mismatch
• Schema management
• Logging SQL statements
• Integration testing with Docker and Testcontainers

2. Mapping Types - 50m

• Compact column types
• JPA and Hibernate Types
• Custom Hibernate Types
• The Hypersistence Utils project

3. Mapping Identifiers - 55m

• Natural and surrogate keys
• UUIDs and clustered indexes
• JPA and Hibernate identifiers
• Hibernate identifier optimizers (e.g., pooled, pooled-lo)

4. Relationships - 1h 45m

• JPA and Hibernate relationships
• Equals and Hashcode
• ManyToOne
• OneToMany
• ElementCollection
• OneToOne
• ManyToMany

5. Persistence Context - 1h 45m

• Persistence Context and entity state transitions
• Flushing and Hibernate Action Queue
• Dirty checking mechanism
• Bytecode enhancement dirty checking

Day 2

6. Batching and Statement Caching - 1h 45m

• Statement vs. PreparedStatement batching
• SQL injection
• JDBC batching for INSERT, UPDATE, and DELETE
• Hibernate automatic batching
• Sorting INSERT and UPDATE statements
• Statement lifecycle
• Statement caching

8. Fetching - 1h 45m

• Statement fetch size
• Pagination Best Practices: Offset vs. Keyset
• Projections and mapping tabular result sets to tree-based structures
• Entity fetching
• DTO projections vs. Entity queries
• FetchType.LAZY vs. FetchType.EAGER
• Preventing N+1 query issues
• Streaming data
• Query plan cache settings

9. Connection and Transaction Management - 1h 45m

• Spring and Hibernate connection management
• Connection pooling
• Connection monitoring
• Read-only and Read-write transactions
• Transaction routing

10. Caching - 1h 45m

• Cache synchronization strategies
• Database caching
• Application-level caching
• Hibernate second-level caching

Prerequisites/ Required knowledge

It is recommended to bring your own notebook so that you can configure and run tests associated with the material we are going to go through this training.

It is expected that attendees are familiar with Java, Maven, and IDE tools like IntelliJ IDEA or Eclipse.

The attendees can set up the test environment we are going to use during the training by following the instructions provided in the training GitHub repository:

Target audience

This workshop is for any Java developer who happens to work with Spring Data JPA.