News for hackers. Stuff that matters.
Re:Paginating Requests in APIs (2020) by tzahifadida on Sunday May 29, 2022 @01:24AM (#31546637)
It's a product thing. For visual pagination, people are used to skip pages. So you have to use offsets. You can limit the the number of pages you can request and the size. For machine api's, you can design the most efficient solution. Which is probably some streaming solution. But these are difficult for clients. So usually you compromise. Most of the time I use pages because I don't want developers to churn of this is too hard for them to use keys or cursors. You can also use a schema based tenant system where applicable which makes the problems easier with smaller indexes and tables to sort.
Re:Paginating Requests in APIs (2020) by ignaciochiazzo on Tuesday May 31, 2022 @11:48PM (#31577833)
Sometimes the data is so big, and performance is critical that you don't have any other option than not to use offset.