Pagination is not one-size-fits-all

Every API that returns a list eventually needs pagination. The naive approach of ?page=1&limit=20 works for small datasets, but as your data grows, you'll hit performance cliffs and consistency issues. Let's break down the three main patterns, when to use them, and the tradeoffs.

Offset pagination (the classic)

GET /items?offset=40&limit=20

Enter fullscreen mode