QamoosTech
Web & APIsAPI designIntermediateJavaScript

Over-Fetching and Under-Fetching

PronunciationOH-ver-FECH-ing

Definition

Over-fetching is when an API returns more data than the client needs. Under-fetching is the opposite: one endpoint doesn't return enough, so the client must make extra requests.

Where you hear it

In REST vs GraphQL comparisons, mobile performance reviews and API design discussions.

Examples

  • The list endpoint returns full profiles when we only need names; that's over-fetching.
  • The screen needs three requests to render; that's under-fetching.
  • The mobile app gets full product records but only displays the title and the price.

Common mistake

Fixing it by adding a new endpoint per screen. Field selection or a well-designed query layer scales better.

Don't confuse with

The N+1 query problem, which is about a server making too many database queries, not too much data over the network.

Say it at work

  • In a meeting or chatLet the client pick the fields it needs.
  • In an email or ticketWe're over-fetching on mobile.