Interview's MateSystem Design
Interview's Mate

System Design

Architecture & trade-offs

Visualizer

DSA Visualizer
All 32 lessons
Custom Playground
Try your own examples

Learning

System Design
31 architecture topics
SQL Learning
160 foundations → production topics
AI Engineering
160 LLM → backend topics
Data Science
160 Python → MLOps topics
Data Engineer
160 SQL → streaming topics
Docker
160 Docker learning topics
Kubernetes
160 K8s fundamentals → cloud
Java LearnSoon
Coming soon
Python Learn
Interview Q&A & internals
JavaScript Learn
Closures, async & DOM Q&A
Tech Learn
Search, practise & track Q&A
AI DSA Practice
Solve coding problems
Theme
Home
All topics/API Design & Gateways
DISTRIBUTED SYSTEMS & ARCHITECTURE · SUBTOPIC

REST vs. GraphQL vs. gRPC

Pick the right API paradigm for public APIs, mobile BFFs, and internal microservices.

BeginnerPart of API Design & Gateways
Practice in AI HLD
Subtopics in API Design & Gateways (2)
OverviewREST vs. GraphQL/gRPCPagination & Idempotency

In plain words

REST is a fixed restaurant menu (Order #3 gives burger + fries). GraphQL lets you customize exactly what’s on your plate in one trip. gRPC is kitchen shorthand yelled quickly between chefs.

Think of it like…

Fixed combo meal (REST), custom salad bar (GraphQL), internal shorthand (gRPC).

Loading interactive diagram
Loading interactive exercise

Theory & how it works

The hidden trap of GraphQL

GraphQL eliminates over-fetching on mobile, but makes HTTP/CDN caching harder (since most queries POST /graphql) and opens you to N+1 resolver explosions or deeply nested malicious queries unless you add DataLoader batching and query-depth limits.

Key points & practical guide

Summary checklist

  • REST = simple, HTTP-cacheable, great default for public APIs
  • GraphQL = avoids mobile over-fetching; enforce depth/cost limits
  • gRPC = binary Protobuf speed for internal microservice traffic

When to use it

  • REST for public APIs
  • GraphQL for mobile BFFs aggregating many sources
  • gRPC for internal service meshes

Watch out for

  • Returning unbounded lists in REST/GraphQL without pagination limits

Quick check

Loading quiz
Parent topic
API Design & Gateways
Next subtopic
Cursor Pagination & Idempotent APIs