Two pages, one quiet gap
A client asks for the first page of an order list, ten rows at a time. Between that request and the next, one new order is inserted at the top. The second page starts at offset ten, and because everything moved down by a single row, the row that used to be tenth has already been shown while the new eleventh row never appears. Both responses carry a success status. Neither one flags the gap. The pointer advances, and the missing row stays missing.
That is the structural weakness of offset pagination: the number sent to the server is a position, and the identity of a row is nowhere in the request. Skip ten rows works cleanly against a table nobody touches. Against a live collection, it misaligns the instant anything above the boundary is added or removed.
Microsoft's REST API guidelines say so without softening. Even with a consistent sort order enforced at the server, results may be missing or repeated based on creation or deletion of other resources. The same section tells services to encode the record ID of the last read record so clients can handle duplicates and gaps, and to append a tiebreaker sort — usually the key — so item order stays deterministic. Read that closely: the guidance never promises a snapshot. It offers a best-effort stable order plus the raw material for a client to notice when the boundary slid.
What each model actually promises
| Signal | Source and scope | What the client does |
|---|---|---|
| Missing or repeated rows under consistent sorting | Microsoft REST API Guidelines, fixed commit | Treat duplicates and gaps as normal, reconcile by record ID |
| Empty continuation token | AIP-158, Google's own convention | Stop paging; do not infer an end from a row count |
| Cursor must be opaque | Relay connections specification | Carry the token back unchanged, never parse it |
| Large-offset scan cost | Winand's signed article, citing SQL:2023 | Anchor deep pages on the last sort value instead |
| Total may be an estimate | AIP-158, explicitly labelled | Ask for a count separately; tolerate approximation |
Microsoft splits pagination into two families. In server-driven paging, the response carries a continuation token, sometimes surfaced as @nextLink; no token means no further page, and the client handles the continuation URL as an opaque value. In client-driven paging, $top and $skip do the work, with skip applied before top, and sorting and filtering held constant across pages. A server that cannot honour those parameters must return an error rather than quietly ignoring them.
Google's AIP-158, approved in 2019 with a changelog running to 2025, chose the server-driven shape. Its page_size defaults to at most 50 and is capped at 1000, though those figures belong to Google's own API convention; no source here presents them as a cross-industry default. An empty next_page_token is the sole end-of-collection signal. The token must be opaque: Base64-encoding a transparent value does not count as sufficient obfuscation, and AIP-158 offers a three-day expiration rule of thumb. Skip, where it appears, counts resources rather than pages.
Three things that get conflated
Relay's GraphQL Cursor Connections Specification shows the same contract at the schema layer. A connection exposes edges and pageInfo; each edge carries a node and a cursor; every cursor must be treated as opaque. The PageInfo type carries non-null hasPreviousPage and hasNextPage booleans plus nullable startCursor and endCursor. The algorithm filters with before or after first, then slices with first or last, and the spec strongly discourages using first and last together.
Keep three concepts apart. Keyset, or seek, pagination is a SQL technique: anchor the next page on the last sort value already seen, in the shape of WHERE id < ?last_seen_id ORDER BY id DESC FETCH FIRST 10 ROWS ONLY. A cursor is the API-layer token handed back to a client, which relays it without understanding it. Neither one is a database server cursor — no DECLARE ... CURSOR is held open across HTTP requests. Mixing them up tends to produce clients that try to decode tokens, or servers that imply a token freezes the underlying table.
The boundary where offset is still fine
Markus Winand, in a signed article on Use The Index, Luke!, argues that offset accepts exactly one thing — the number of rows to discard — and calls the habit of counting rows seen and skipping them later simply wrong once inserts land between pages. His piece cites SQL:2023 on the forced scan cost of large offsets. It is an author's argument published on a personal site; no standards body issued it as a ruling. The piece also comes with a concession: keyset pagination cannot jump straight to an arbitrary page. Infinite scroll does not care about that. A dashboard with numbered page links very much does.
Blanket bans therefore miss the point. Microsoft still permits $top and $skip in client-driven paging, provided the parameters stay consistent and unmet requests fail loudly. Small, slow-moving datasets and interfaces that genuinely need page-number jumps are reasonable offset territory. Large tables, collections changing in real time, and infinite scrolls are where token-based paging earns the extra plumbing. The decision is a boundary drawn from data shape and navigation needs; a sweeping verdict on one technique overlooks where each one works.
Stability carries a smaller asterisk. Keyset paging avoids boundary drift only while the sort key stays immutable and unique. Update that key — re-rank an item, change the timestamp being sorted on — and a row can cross the anchor anyway. The extra tiebreaker Microsoft asks for helps keep order deterministic, but it cannot manufacture a frozen view the database never supplied.
Totals are a separate request
A row count sounds like a property of the collection, yet neither guideline treats it as a free byproduct of paging. AIP-158 declares total_size optional and says it may be an estimate, requiring services to state that explicitly. Microsoft exposes totals through an optional $count=true in the client-driven model. Neither source publishes a cost figure for computing an exact count, so this article will not invent one. The usable conclusion is narrower and still practical: a client needing a precise number should ask for it separately and tolerate an approximate answer; a client needing only to know whether another page exists can read the token.
Where the shared runtime fits
Pagination drift is a contract problem that repeats across every host surface. A shared runtime and an open catalog let one paging implementation — one set of token semantics, one set of gap-reconciliation rules — reach multiple hosts without being rebuilt per surface. That is a structural claim, and no pagination benchmark specific to mini-programs appears in the sources consulted here. Under Cross Mini App, the same paging contract can travel between host surfaces instead of being rewritten for each one.