Open
Conversation
sparhk
reviewed
Feb 25, 2026
| - Users must be able to jump to an arbitrary page, this is a validated user need and not just an assumed one. | ||
| - UX requirements genuinely call for it, and the above technical factors do not contradict it. | ||
|
|
||
| **Note:** Cursor is also the safer default: switching from cursor to offset later is straightforward, but the reverse |
kevin-wise
reviewed
Feb 25, 2026
| Use cursor-based pagination when: | ||
|
|
||
| - The dataset is large, unbounded, or expected to grow significantly over time. | ||
| - The underlying database is NoSQL or sharded, where offset scanning is expensive or unreliable. |
There was a problem hiding this comment.
is it worth adding somewhere (either to this bullet or elsewhere) that sometimes databases support cursors natively (i.e. Datastore)?
- The database supports cursor-based pagination natively
Collaborator
Author
There was a problem hiding this comment.
Just about every modern database supports cursor-based pagination natively today. Saying something like "only some databases natively support cursors" implies others don't, which would be misleading.
But I think I understand what you are trying to get at though. It's more about NoSQL and sharded databases tend to make offset pagination actively painful or explicitly don't support it?
So how about something more like this?
- The underlying database is NoSQL or sharded. These databases are often designed around
cursor-style access and may not support offset scanning at all or do so at significant
performance cost.…set option. Add guidance on when to choose each method.
4548983 to
01e19dd
Compare
bryanstephens
approved these changes
Feb 25, 2026
…ename offset/limit to pageNumber/pageSize.
c04f2e9 to
b577f1d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Change guidance to allow both offset and cursor. Remove the token offset option. Add guidance on when to choose each method.