Skip to content
StackDecode
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.

ClientAggregatorUsers APIOrders APIPricing API
  • 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

  1. 1Client sends sort=field
  2. 2Server validates the field
  3. 3Query orders with an index
  4. 4Results return sorted

Where it is used

Lists and tables.

Watch out for

Allow only indexed sort fields.

Related