3 ms·
+1 to what your other response said You have to remember the goal of pagination: to move through a collection of results sequentially. If your underlying page
by caseysoftware 7y ago
+1 to what your other response said
You have to remember the goal of pagination: to move through a collection of results sequentially. If your underlying page is constantly changing (as the other response noted), then you have NO way to know what should be your next intended offset/page to move either or back.
A simple sort with "results always go here" seems like a good approach but now you're packing additional understanding into using your API which is totally out of band with it. Or using a different sort blows it up rending that approach useless.
Cursors are the only approach that actually accomplishes the goal.
- bradleyjg 7y agoIf the underlying data is constantly changing, how do cursors solve that problem? The only guarantee I get asking for the next page after a given item is that it won't contain the last item I've already seen. There's no other inherent guarantees. The page could contain all items I've already seen, early pages (in this new version of the underlying dataset) could have items I've never seen, and so on. It's as arbitrary as page numbers but without the corresponding convenience.
- deleted 7y ago[deleted]