API pagination best practices

前端 未结 11 1232
执念已碎
执念已碎 2020-11-28 17:12

I\'d love some some help handling a strange edge case with a paginated API I\'m building.

Like many APIs, this one paginates large results. If you query /foos, you\'

11条回答
  •  臣服心动
    2020-11-28 17:41

    Just to add to this answer by Kamilk : https://www.stackoverflow.com/a/13905589

    Depends a lot on how large dataset you are working on. Small data sets do work on effectively on offset pagination but large realtime datasets do require cursor pagination.

    Found a wonderful article on how Slack evolved its api's pagination as there datasets increased explaining the positives and negatives at every stage : https://slack.engineering/evolving-api-pagination-at-slack-1c1f644f8e12

提交回复
热议问题