Part I β The Pipes Β· Lesson 1.8
Choosing: REST vs GraphQL vs gRPC
In one linePick by who the clients are and how nested the data is β not by what's newest.
Where you've seen itShopify ships all three β REST for public third-party apps, GraphQL for its own admin UI, gRPC between internal services.
Diagram
DECISION TREE
Who calls this API?
β
βββββββββββββββββββββΌββββββββββββββββββββ
βΌ βΌ βΌ
Unknown 3rd Your own Another service
parties frontend (server-to-server)
β β β
βΌ βΌ βΌ
REST Is the data High volume or
(browsable, deeply nested streaming?
cacheable, / per-screen? β
versioned) β βββββββ΄ββββββ
βββββββ΄ββββββ βΌ βΌ
βΌ βΌ gRPC REST
GraphQL REST (binary, (simple,
typed) debuggable)COMPARISON MATRIX
REST GraphQL gRPC
ββββββββββββββββββββββββββββββββββββββββββββββββββββ
Payload JSON JSON Protobuf
Transport HTTP/1-3 HTTP POST HTTP/2
HTTP caching free manual none
Over-fetching yes no no
Round trips many one one
Browser support native native proxy needed
Schema/types OpenAPI built-in built-in
Streaming SSE/WS subscriptions native
Debug with curl easy awkward noHow it works
- Start from the client. Unknown third parties β REST. Your own app β REST or GraphQL. Another service β gRPC.
- Then check data shape. Nested, screen-specific trees favour GraphQL; flat entities favour REST.
- Then check caching needs. If CDN caching is the main lever, REST wins outright.
- Then check volume. Internal, high-throughput, latency-sensitive β gRPC.
- Combine freely β a BFF that speaks GraphQL outward and gRPC inward is a normal, defensible answer.
THE COMMON REAL-WORLD SHAPE
βββββββββββ GraphQL ββββββββ gRPC ββββββββββββββ
β Browser β ββββββββββΊ β BFF β ββββββββΊ β Services β
βββββββββββ ββββββββ ββββββββββββββ
one query per screen aggregates typed, binary,
+ caches fast internallyTrade-offs
| Don't choose GraphQL if | Don't choose REST if | Don't choose gRPC if |
|---|---|---|
| CDN caching is your main win | Screens need 5+ nested resources | The browser must call it directly |
| Team can't own query governance | Payloads are 10Γ what the UI uses | You need curl-level debuggability |
Interview angle
"Design the API layer for a mobile-heavy social app."
- Mobile bandwidth + per-screen nesting β GraphQL at the edge, one query per screen.
- Keep images and static content on plain REST/CDN URLs so they stay cacheable.
- Internal fan-out (feed, ranking, notifications) over gRPC behind a BFF.
Recap
- Client type first, data shape second, caching third, volume fourth.
- These are layers, not rivals β most real systems run all three.
- Naming the trade-off you accepted matters more than the choice itself.