gRPC vs REST vs GraphQL: Which to Choose
On this page
gRPC vs REST vs GraphQL compared
These aren't competitors so much as tools for different boundaries. Most mature systems use more than one.
| REST (JSON over HTTP) | GraphQL | gRPC | |
|---|---|---|---|
| Contract | OpenAPI, optional | Schema, required | .proto, required |
| Payload | JSON text | JSON text, client-shaped | Binary protobuf |
| Transport | HTTP/1.1 or 2 | Usually HTTP POST | HTTP/2 |
| Streaming | SSE or WebSockets alongside | Subscriptions | Built in, all directions |
| Browser support | Native | Native | Needs gRPC-Web or a gateway (Day 19) |
| Caching | HTTP caches and CDNs | Harder | Not with standard HTTP caches |
| Human debugging | curl, browser | GraphiQL | grpcurl, reflection (Day 20) |
| Code generation | Optional (OpenAPI generators) | Common | Central to the workflow |
| Best at | Public APIs, simple resources | Client-driven data fetching | Fast, typed service-to-service calls, streaming |
Where gRPC, REST and GraphQL each fit
Public and partner APIs: REST. Every language and tool speaks it, HTTP caching and status codes work naturally, and partners can explore it with curl. (See the API design course.)
Your own web and mobile apps: GraphQL or a REST backend-for-frontend. Screens assemble data from many services, and GraphQL lets each screen fetch exactly what it needs in one request.
Between internal services: gRPC. Typed contracts catch mismatches at compile time, generated clients remove boilerplate, binary encoding cuts CPU and bandwidth, deadlines and cancellation propagate, and streaming is built in.
A common shape:
Browser / mobile ──GraphQL or REST──> API gateway / BFF ──gRPC──> orders, inventory, payments, pricing
Partners ──REST + webhooks──> public API ──gRPC──> the same servicesThe edge translates between the outside world's protocols and the internal gRPC services. Tools like gRPC-Gateway and Envoy's transcoding can expose a gRPC service as REST/JSON from the same .proto, using HTTP annotations.
When gRPC is the wrong choice
- The callers are browsers or third parties you don't control.
- HTTP caching matters (public, cacheable content).
- The team is small, the system has few services, and the build tooling isn't worth it.
- You need human-readable traffic for debugging in environments without gRPC tools.
When gRPC shines
- High call volume between services, where serialization cost and payload size add up.
- Polyglot systems: one contract, generated clients in every language.
- Streaming workloads: live updates, uploads, telemetry, chat.
- Mobile apps on unreliable networks talking to your own backend (gRPC has mature mobile libraries), when you control both ends.
Check yourself
Browsers can't call it natively, it needs generated clients and special tools, and HTTP caching doesn't apply; REST is easier for outsiders.
Required typed contracts with generated clients in every language, compact binary encoding, built-in streaming in both directions, and deadlines and cancellation that propagate across calls. With REST, each of these is optional and built differently by each team.
Through transcoding with gRPC-Gateway or Envoy, using google.api.http annotations in the .proto to map each RPC to an HTTP method and path. One implementation then serves both gRPC callers and REST clients with JSON.
Usually more efficient in serialization and connection use, but for small payloads the difference is often minor compared to network and database time.
When many client screens need flexible combinations of data, such as a web or mobile frontend, rather than fixed service-to-service calls.