None of the last three lessons' technologies is a strictly better version of the others — each one was built by optimizing for a specific situation, and the choice that fits one part of a system is often the wrong choice for a different part of that same system.
3 min read
Rather than "which technology is best," the more useful question is "who's the primary consumer of this specific API, and what do they actually need from it":
It's entirely normal — common, even, at real scale — for one company's architecture to expose a public REST API to partners, serve its own web app through a GraphQL layer that aggregates several backend services into client-friendly shapes, while those backend services talk to each other over gRPC internally. Choosing one technology as "the API layer" for an entire company is usually the wrong framing; the right framing is choosing per boundary, based on who's actually on the other side of that specific boundary.
Once an API has real external consumers — the same "cost of change" theme from System Design's versioning lesson — switching from REST to GraphQL (or vice versa) for a public-facing API is a genuinely large migration, not a quick refactor: it usually means running both in parallel during a long transition, not a clean swap. This is a real argument for thinking carefully about the primary consumer before building the first version, rather than treating the initial choice as easily reversible later.
GraphQL's flexibility looks universally appealing on paper, but a public API with graph-shaped free-form queries is harder to rate-limit predictably (a single query can be arbitrarily expensive depending on how deeply it's nested) and harder to cache with simple, generic infrastructure than a REST API's fixed set of URLs. Teams that adopt GraphQL everywhere by default, rather than for the specific case it's strongest at, often end up re-implementing REST-like restrictions (query complexity limits, persisted queries) on top of GraphQL just to get back the predictability REST gave them for free.
Check your understanding
A quick comprehension check — not tracked, not graded, just for you.
1. What question should primarily decide whether an API boundary uses REST, GraphQL, or gRPC?
2. Why is it common for one real system's architecture to use REST, GraphQL, and gRPC all at once?
3. Why can adopting GraphQL for a public-facing API by default backfire?
API Design