Skip to content
StackDecode
System Design
10. API Design and ManagementAnimated

Cursor-Based Pagination

Page using a pointer to the last item seen.

The idea

The cursor encodes the position, giving stable and fast pages for large datasets.

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. 1Return items and a cursor
  2. 2Client sends the cursor back
  3. 3Query items after that position
  4. 4Repeat

Where it is used

Feeds and infinite scroll.

Watch out for

Cannot jump to page N.

Related