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.
Comparison
| Criterion | gRPC | REST/HTTP |
|---|---|---|
| Contract | .proto required, generated code | Optional (OpenAPI), flexible JSON |
| Payload | Binary (Protobuf), compact | Text (JSON), readable |
| Transport | HTTP/2 | HTTP/1.1, HTTP/2 or HTTP/3 |
| Streaming | Native, including bidirectional | Separate, via SSE or WebSocket |
| Browser | Via gRPC-Web + proxy | Native |
| HTTP cache | Not applicable (POST) | GET cacheable in browser and CDN |
Notes
- 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.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.Browsers don’t speak gRPC directly: you need gRPC-Web and a proxy in between, and client or bidirectional streaming isn’t supported.
- 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/