r/SpringBoot • • Sep 13 '26

Question Pagination in Springboot

If you're ar working on springboot project in you company/job. How does your team do pagination in your project as they have large datasets. I am currently learning springboot and curious to know how it's done withel large datasets.

56 Upvotes

33 comments sorted by

View all comments

5

u/BeyondFun4604 Sep 13 '26 edited Sep 13 '26

https://docs.spring.io/spring-data/commons/docs/current/api/org/springframework/data/domain/Slice.html

We switched from Page to Slice since it just contains info if previous and next page exists. But to get good perfromance an optimised database view is the first requirement.

2

u/Paw565 Sep 13 '26

Good query with index is sufficient imo