© Anghel Leonard 2020
A. LeonardSpring Boot Persistence Best Practiceshttps://doi.org/10.1007/978-1-4842-5626-8_4

4. Batching

Anghel Leonard1 
(1)
Banesti, Romania
 

Item 46: How to Batch Inserts in Spring Boot Style

Batching is a mechanism capable of grouping INSERT, UPDATE, and DELETE statements and, as a consequence, it significantly reduces the number of database/network round trips. Fewer round trips usually results in better performance.

Batching can be the perfect solution for avoiding performance penalties caused by a significant number of separate database/network round trips representing inserts, deletes, or updates in a database. For example, without batching, having 1,000 inserts requires 1,000 separate round trips, while employing batching ...

Get Spring Boot Persistence Best Practices: Optimize Java Persistence Performance in Spring Boot Applications now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.