News for hackers. Stuff that matters.
Re:Building APIs: A Comparison Between Cursor and Offset Pag... by simonw on Saturday April 17, 2021 @11:07AM (#26844750)
Cursor based pagination is much better from a performance point of view against large amounts of data.

It's also sometimes called keyset pagination - there's a good article about that here: https://use-the-index-luke.com/no-offset

I implemented it in https://datasette.io - it's quite tricky to build if you want to support arbitrary sort orders.

Re:Building APIs: A Comparison Between Cursor and Offset Pag... by andrewingram on Saturday April 17, 2021 @11:11AM (#26844805)
I built a utility for Graphene + Django to do it properly with arbitrary sorts, though one does need to be careful about exposing sorts orders which aren’t backed by any indexes.