Building APIs: A Comparison Between Cursor and Offset Pagination?

https://news.ycombinator.com/item?id=26843504
by kasrakhosravi2 • 5 years ago
37 25 5 years ago

I have been mostly relying on offsets for implementing paging. It is more straightforward in implementation but I find cursor based pagination more intuitive in usage; plus it has better support for real-time data but on the negative side you are forced to use infinite scroll which is not always the best solution.

I was curious if anybody has any experience with these two approaches in their projects? And what are some other advantages and disadvantages on this? [1]

[1] I wrote this piece a while back but was thinking of updating it further: https://betterprogramming.pub/building-apis-a-comparison-between-cursor-and-offset-pagination-88261e3885f8

Related Stories

Loading related stories...

Source preview

news.ycombinator.com