Pagination
Also known as: paging, offset pagination, cursor pagination.
Splitting a long list into pages fetched one at a time. How you page decides whether items can be skipped or repeated when the list changes.
Synthetic dataExamples on this page use synthetic data created for illustration.
Definition
Pagination splits a long result list into pages that a client requests one at a time. Offset paging says “skip N, give me M”; cursor paging says “continue after this item”. When the data changes during the read, the choice decides whether items are skipped or repeated.
In plain terms
Lists change while you read them. With offset paging, one new item at the top pushes every later item down a place, so the next page starts one item too early and shows a repeat; a deleted item does the opposite and an item is skipped. Cursor (keyset) paging anchors to a specific item and is steadier.
For anyone building a record of a list, the rule is simple: a list captured in pages is complete only if every page was read. If a page fails, call the capture partial, and never conclude from it that an item has “disappeared from the list”.
Example
A list holds A, B, C, D, E, F; the page size is 3.
| Step | Offset paging | Cursor paging (“after C”) |
|---|---|---|
| Read page 1 | A, B, C | A, B, C |
| A new item Z is added at the top | list is now Z, A, B, C, D, E, F | same |
| Read page 2 | skip 3 → C, D, E (C repeated, F never seen) | D, E, F |
The offset reader ends with a repeat and a gap; the cursor reader has every item once.
Common misunderstandings
- “Paging gives a consistent snapshot.” Only if the interface explicitly promises it; usually each page is read from the live data.
- “A failed last page is a small problem.” It makes the capture partial, and absence conclusions drawn from it are unsupported.
- “Page numbers identify items.” Positions shift as the list changes; use stable item identifiers.
References
- M. Nottingham. RFC 8288: Web Linking . IETF, 2017.
- AIP-158: Pagination . Google API Improvement Proposals.