~/talk

Overcoming N+1 API Calls in React: Strategies for Efficient Data Fetching

Talkat BlaBlaConf 2025 · 2025-02-03..02-07· [frontend-architecture, react]
slides:none on file

N+1 happens when components request related items one by one, so the concrete fix is to replace repeated fetches with a batching list endpoint that returns all needed IDs in one response, add React Query caching (or GraphQL queries) to reuse results, normalize large records into an index so subsequent lookups avoid refetching, debounce client typing at 300ms debounce to avoid rapid requests, and use Next.js SSR + CDN to serve preloaded HTML and reduce client fetches — these changes cut per-page requests from dozens to one or two.

AI-written summary · about

  1. 0:00Introduction
  2. 1:08What is N+1 problem
  3. 3:15Why N+1 queries matter
  4. 9:52Caching strategies
  5. 14:53Batching requests
  6. 17:03Normalization and global state
  7. 20:41Pagination and lazy loading
  8. 22:06Server-side rendering
  9. 23:59Debouncing user input
  10. 26:46Tools and libraries
  11. 27:48Challenges in frontend development
  12. 29:18Full-stack solutions
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.