System Design
10. API Design and ManagementAnimated
API Pagination
Returning large lists in pages.
The idea
Limit result size and let the client ask for the next page.
Watch it work
Press play, pause, or step through. Some animations have settings you can change.
- client
- gateway / proxy
- service
- cache
- data store
- queue / stream
One client call, several backends.
- step:
- 1/4
- at:
- Client
1/11
The green dot is a request moving through the system.
Step by step
- 1Client asks for a page size
- 2Server returns items and a next link
- 3Client requests the next page
- 4Repeat until done
Where it is used
Lists and feeds.
Watch out for
Pages shift when data changes during paging.