GET /products?limit=50&offset=100
Gets products in the database starting from "101-150"
Pros
- Simple to implement for client and server
- Possible to jump to pages
Cons
- Unreliable results
- Inefficient for very large databases.
Uses only limit in requests
GET /products?limit=50
Server responds with results and a next-cursor and includes cursor in subsequent requests
GET /products?limit=50&nextCursor=12345
Pros
- Improved performance
- Consistent Results
Cons
- Clients need to traverse through each page.
- Records might be added to the page at random positions (Less likely)
- Clients need to manage next cursor.