cursor pagination
Paging by remembering the position of the last item seen and asking for items after it, such as ?after=2&limit=2.
In more detail
Because it continues from a position in a stable order rather than a count, inserts and deletes do not shift later pages. The order must end with a unique tie breaker, and the cursor must remember the full sort position. An opaque cursor lets the server change how it encodes that position.
Related terms
- offset pagination — Paging by saying how many items to skip, such as ?limit=2&offset=4.
- tie breaker — A final unique field, usually the identifier, added to a sort order so items with equal values always come out in the same order.
- next link — The link a paginated response gives to the following page, which the client should follow exactly as supplied.
- sort key — The field a collection is ordered by, chosen by the client from a small documented list, such as sort=title or sort=-id for descending.
Taught in
- HATEOAS And Hypermedia — Modern API Architecture: REST, GraphQL & gRPC
- Pagination Strategies — Modern API Architecture: REST, GraphQL & gRPC
- Sorting Results — Modern API Architecture: REST, GraphQL & gRPC