Skip to content

Concepts

Engineering on one sheet: one topic at a time, with a diagram, the points that matter and the trade-off. Short enough to read between two meetings, precise enough to defend in a design review.

gRPC vs REST/HTTP

gRPC isn’t a “faster REST”: it’s a different contract. The choice depends on who calls the API — another service or a browser.

View A

Comparison

CriteriongRPCREST/HTTP
Contract.proto required, generated codeOptional (OpenAPI), flexible JSON
PayloadBinary (Protobuf), compactText (JSON), readable
TransportHTTP/2HTTP/1.1, HTTP/2 or HTTP/3
StreamingNative, including bidirectionalSeparate, via SSE or WebSocket
BrowserVia gRPC-Web + proxyNative
HTTP cacheNot applicable (POST)GET cacheable in browser and CDN

Notes

  1. 1.gRPC starts from a Protocol Buffers contract (.proto) and generates typed clients and servers. REST/HTTP usually carries JSON, with an optional contract (OpenAPI).
  2. 2.gRPC runs on HTTP/2 and has four call shapes: unary, server streaming, client streaming and bidirectional. In REST, streaming is solved separately, with SSE or WebSocket.
  3. 3.Browsers don’t speak gRPC directly: you need gRPC-Web and a proxy in between, and client or bidirectional streaming isn’t supported.
  4. 4.REST leans on HTTP semantics: GET is cacheable in browsers and CDNs, status codes and tools everyone already has. gRPC calls are POST and skip standard HTTP caching.

When to use

gRPC between internal services, when latency, a strong contract and streaming matter. REST/HTTP at the edge: public APIs, direct browser consumption and responses that benefit from caching. Often the answer is both: REST or a BFF for the frontend, gRPC inside.

Trade-offs

gRPC charges in tooling and debugging: a binary payload can’t be read in DevTools, and browsers need a proxy. REST charges in discipline: without a generated contract, breaking changes show up in production.

References

Sheet

02 / 03

Type

comparison

Category

Networking & protocols

Level

Intermediate

Tags

api · http/2 · frontend

Published

[DATE]

Address

fabricioereche.dev/en/concepts/grpc-vs-rest-http/