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

13. Pagination

Anghel Leonard1 
(1)
Banesti, Romania
 

Item 94: When and Why Offset Pagination May Become a Performance Penalty

Offset pagination is very popular and Spring Boot (more precisely, Spring Data Commons) provides support for it via the Page and Slice APIs. However, while your project evolves and data is accumulating, relying on offset pagination may lead to performance penalties even if it was not an issue at the start of the project.

Dealing with offset pagination means you can ignore the performance penalty induced by throwing away n records before reaching the desired offset. A larger n leads to a significant performance penalty. ...

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.