News for hackers. Stuff that matters.
Re:Building APIs: A Comparison Between Cursor and Offset Pag... by juancn on Saturday April 17, 2021 @11:10AM (#26844790)
Offset pagination is hard on the backends. You can distribute some of the sorting load (see: https://engineering.medallia.com/blog/posts/sorting-and-pagi... ), but it's tricky, and less efficient in any case.

Cursor based pagination is way better, since the backend aggregation bucket size is capped by the page size times the number of nodes used for a distributed sort (essentially you aggregate on page sized priority queues, one per node, and then aggregate them).

There are no comments on this comment yet.