Pagination of custom REST services

Previous Next

Pagination is a good way of handling large API responses, It helps minimise response time and improves the end-user experience. With pagination, large set of data are returned in the form of a series of pages. Pagination implies a default sort order of records. This sort order may be based on a unique identifier, on a creation date value, or on a combination of both. The sort order must not change between two requests if records are also being manipulated (INSERT/DELETE/UPDATE).

You can implement pagination in different ways, depending on the type of service you want to provide, on how fast the data set is growing, on the type of data that the service provides, and on the user experience that you want to create.

 

 

collapseOffset pagination
collapseKeyset pagination

 

 

See also

Organising services

Creating your own services