Comparisons
Ten pairs that get conflated in real conversations. Neither column wins — what decides is the requirement. Each record leads with the confusion, because the confusion is the reason the record exists.
Authentication vs AuthorizationServer sessions vs TokensORM vs Raw SQLOptimistic vs Pessimistic concurrencySynchronous vs Asynchronous communicationOffset vs Cursor paginationLocal (in-process) vs Distributed cacheMonolith vs MicroservicesHorizontal vs Vertical scalingAt-least-once vs "Exactly-once"
Offset vs Cursor pagination
What people get wrong about this pair
Offset pagination is thought of as merely slower at high offsets. The worse problem is correctness: with rows being inserted or deleted between requests, a client walking pages will silently skip and repeat records, and no amount of indexing fixes that.
Offset / limit
Use it when
Small, stable datasets where jumping to an arbitrary page is a real requirement — admin tables, short lists.
Cursor (keyset) pagination
Use it when
Large or actively changing datasets, infinite scroll, and any API a machine will walk end to end.
| Dimension | Offset / limit | Cursor (keyset) pagination |
|---|---|---|
| Cost of deep pages | Server scans and discards the skipped rows | Seeks directly using the index |
| Stability under writes | Items shift between pages | Stable — anchored to a real row |
| Jump to page N | Yes | No — next and previous only |
| Total count | Natural to provide | Usually a separate, often approximate query |
| Requires | An ORDER BY | A stable, unique sort key (often a tiebreaker column) |
| Client contract | Simple, familiar | Opaque token the client must not construct itself |