Video summary

API Pagination: Making Billions of Products Scrolling Possible

Main summary

Key takeaways

Technology

Video topic

API pagination — splitting large result sets into manageable pages and when to use different approaches.

Key concepts and takeaways

Purpose

Pagination breaks large API result sets into smaller batches (commonly 10–100 items) to:

  • Reduce server load
  • Lower network traffic
  • Keep client apps responsive

Two main approaches

  • Offset-based pagination
  • Cursor-based pagination

Offset-based pagination

Forms:

  • Page-based: page number + page size
  • Offset/limit: direct use of offset and limit values

Pros:

  • Simple to implement
  • Maps directly to SQL (LIMIT/OFFSET)

Cons:

  • Poor performance for large offsets (the database may need to scan up to the offset)
  • Inconsistent results when data changes between requests (items can shift, be missed, or duplicated)

Cursor-based pagination

How it works (walkthrough):

  1. Choose an index column (commonly a unique ID) or a timestamp to act as the cursor.
  2. Optionally hash/encode the cursor value for security or obfuscation.
  3. Client sends the last-seen cursor to request the next batch.
  4. Server filters using the cursor (e.g., WHERE id > cursor) and returns results plus a new cursor for the last item.
  5. Client uses that new cursor for the following request.

Pros:

  • Consistent and efficient for very large or rapidly changing datasets
  • Avoids scanning preceding rows (better performance at scale)
  • Well suited for real-time feeds

Cons:

  • More complex to implement than offset-based pagination

Variants of cursor-based pagination

  • Keyset pagination: Uses indexed keys (e.g., primary key) to fetch the next rows efficiently without scanning preceding rows.
  • Time-based pagination: Uses timestamps as cursors — useful for time-series data and feeds.

Recommendation

  • Use cursor/keyset/time-based pagination for large, fast-changing datasets.
  • Use offset-based pagination only for small or static datasets where simplicity is more valuable than scalability or consistency.

Guides / tutorial content included in the video

  • Short tutorial/walkthrough on implementing cursor-based pagination (choose a cursor, optionally hash it, use it to filter results, and return a new cursor).
  • Comparative guidance laying out trade-offs to help decide between offset vs. cursor approaches.

Referenced resource / call-to-action

Mentions a “System Design” newsletter/blog covering large-scale system design topics (subtitle text in the video appears garbled). The video suggests subscribing for more content.

Main speaker(s) / sources

  • Unnamed video narrator (single presenter)
  • Referenced resource: “System Design” newsletter/blog (exact URL in subtitles is garbled)

Rate this summary

Your feedback will help improve summaries.

Improve this summary

Reprocess with a stronger model when the summary feels incomplete or inaccurate.

Pro

Translate summary in another language

Pro

Ask questions to this video

Chat for follow-up questions, clarifications, and source-backed answers.

Coming soon

Share this summary

Original video