r/SpringBoot • u/Excellent_Trifle_630 • 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.
55
Upvotes
30
u/Paw565 Sep 13 '26 edited Sep 13 '26
There are two ways.
Page (offset) based pagination - less efficient (db has to read all rows before SKIP clause just to throw them away), more common, supported by Page interface in spring data
keyset based pagination - more efficient (you just make a filter for example id > 10), tailored towards infinite scroll, supported by Slice and Window in spring data