System Design
10. API Design and ManagementAnimated
API Sorting
Ordering results.
The idea
The client names the sort field and direction; the server uses an index to order efficiently.
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 sort=field
- 2Server validates the field
- 3Query orders with an index
- 4Results return sorted
Where it is used
Lists and tables.
Watch out for
Allow only indexed sort fields.