System Design
10. API Design and ManagementAnimated
Offset-Based Pagination
Page by skipping a number of rows.
The idea
Uses offset and limit. Simple, but deeper pages are slower and can skip or repeat items.
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 sends offset and limit
- 2Database skips the offset rows
- 3Returns the next rows
- 4Client increases the offset
Where it is used
Small datasets and admin tables.
Watch out for
Large offsets are slow and unstable.