Catalog My learning Blog
gRPC and Protobuf Tutorial: Fast Microservice APIs · Phase 1 · Lesson 5 · 3 min read

gRPC vs REST vs GraphQL: Which to Choose

On this page
  1. gRPC vs REST vs GraphQL compared
  2. Where gRPC, REST and GraphQL each fit
  3. When gRPC is the wrong choice
  4. When gRPC shines
  5. Check yourself

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)GraphQLgRPC
ContractOpenAPI, optionalSchema, required.proto, required
PayloadJSON textJSON text, client-shapedBinary protobuf
TransportHTTP/1.1 or 2Usually HTTP POSTHTTP/2
StreamingSSE or WebSockets alongsideSubscriptionsBuilt in, all directions
Browser supportNativeNativeNeeds gRPC-Web or a gateway (Day 19)
CachingHTTP caches and CDNsHarderNot with standard HTTP caches
Human debuggingcurl, browserGraphiQLgrpcurl, reflection (Day 20)
Code generationOptional (OpenAPI generators)CommonCentral to the workflow
Best atPublic APIs, simple resourcesClient-driven data fetchingFast, typed service-to-service calls, streaming
REST suits public and partner APIs, GraphQL suits client apps assembling varied data, and gRPC suits internal service-to-service calls and streaming.
REST suits public and partner APIs, GraphQL suits client apps assembling varied data, and gRPC suits internal service-to-service calls and 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:

Code
Browser / mobile ──GraphQL or REST──> API gateway / BFF ──gRPC──> orders, inventory, payments, pricing
Partners          ──REST + webhooks──> public API          ──gRPC──> the same services

The 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.