coldwa.st
All guidesProgrammingWebDataToolsDatabasesHaskellConceptsCabal & buildsToolchainCompilerPerformanceEditor & HLS

Programming · web · APIs

gRPC vs REST

By ColdwastUpdated Jun 18, 20268 min read#grpc#rest#api
A network switch with fibre-optic and Ethernet cables plugged in
Two ways for services to talk over the network — REST optimises for universality, gRPC for speed and typed contracts.

When you design how two programs talk over a network, the modern fork is REST vs gRPC. Both expose functionality over HTTP, but they make opposite bets: REST favours human-readable, universal simplicity; gRPC favours fast, typed, binary efficiency. This guide compares them honestly on format, performance, streaming, browser support and tooling — and when to pick each. (New to APIs? Start with what is an API.)

The core difference

  • REST — an architectural style on HTTP: resources at URLs, HTTP verbs (GET/POST/PUT/DELETE), usually JSON. Human-readable, stateless, universal.
  • gRPC — a framework for remote procedure calls: you call methods (like local functions) defined in a .proto contract, exchanging binary Protocol Buffers over HTTP/2.

REST is resource-oriented ("get this thing"); gRPC is action-oriented ("call this method"). REST is text; gRPC is binary and strongly typed.

Performance and the wire

gRPC's Protocol Buffers are compact binary, sent over multiplexed HTTP/2 connections — smaller payloads, less parsing, many calls over one connection. REST's JSON over HTTP/1.1 is heavier and more verbose, though very well optimised and cacheable. For high-volume service-to-service traffic gRPC's efficiency is real; for a typical public API, REST is usually fast enough and benefits from free HTTP caching.

A data cable connected to server hardware
The choice is a trade-off — match it to who calls your API and how much traffic it carries.

Streaming, contracts and codegen

gRPC supports bidirectional streaming natively (client, server and both-ways), which suits real-time and high-throughput data. Its .proto file is a strict contract from which clients and servers are code-generated in many languages — great for polyglot back-ends and catching mismatches at compile time. REST has no built-in contract (OpenAPI/Swagger is bolted on) and streaming is limited (SSE/WebSockets bolted on), but that looseness is also what makes it easy to start with.

Browser support and ubiquity

This is REST's home turf. Any browser calls a REST API with fetch; every language and tool understands it; you can debug it with curl and read the JSON. Browsers cannot speak raw gRPC — you need gRPC-Web plus a proxy (e.g. Envoy), which adds moving parts. If web front-ends are your main consumers, REST (or GraphQL) is simpler.

Recommended

Somewhere to run your services

REST or gRPC, your API and microservices need a reliable home with full control over the runtime and network. A VPS or cloud server fits. Infomaniak — a Swiss, privacy-respecting host — offers VPS and cloud servers for it.

See Infomaniak cloud →

Affiliate link — supports these free guides.

How to choose

  • Pick REST for public APIs, browser clients, simple resource CRUD, and when human-readability, ubiquity and HTTP caching matter.
  • Pick gRPC for internal service-to-service calls where performance, low latency, streaming and a strict typed contract matter (microservices, real-time, polyglot).
  • Use both — REST/GraphQL at the edge for clients, gRPC between internal services, is a very common architecture.

Frequently asked questions

What is the difference between gRPC and REST?

REST is an architectural style for web APIs built on HTTP, usually exchanging human-readable JSON over resource URLs. gRPC is a high-performance RPC framework that runs on HTTP/2 and exchanges binary Protocol Buffers, defined by a strict .proto contract. In short: REST is resource-oriented, text-based and universal; gRPC is action (method) oriented, binary, typed and fast. They solve the same problem — programs talking over a network — with different trade-offs.

Is gRPC faster than REST?

Usually yes for service-to-service traffic. gRPC sends compact binary Protocol Buffers over multiplexed HTTP/2 connections, which means smaller payloads and less overhead than JSON over HTTP/1.1, and it supports bidirectional streaming. The gap matters most for high-volume internal microservices; for a typical low-traffic public API the difference is rarely the bottleneck, and REST plus HTTP caching can be more than fast enough.

Can gRPC be used in a browser?

Not directly. Browsers cannot speak raw gRPC because they do not expose the low-level HTTP/2 control gRPC needs. You use gRPC-Web with a proxy (e.g. Envoy) as a bridge, which adds complexity and limits some features (like client streaming). REST, by contrast, works natively from any browser with fetch/XHR. If your API is consumed mainly by web front-ends, REST (or GraphQL) is usually simpler.

When should I use gRPC instead of REST?

Choose gRPC for internal service-to-service communication where performance, low latency, streaming and a strict typed contract matter — microservices, real-time data, polyglot back-ends. Choose REST for public APIs, browser clients, simple resource CRUD, and when human-readability, ubiquity and free HTTP caching are priorities. Many systems use both: REST/GraphQL at the edge for clients, gRPC between internal services.

The bottom line

REST and gRPC are not rivals so much as tools for different jobs. REST wins on universality, browser support, readability and caching — the right default for public and web-facing APIs. gRPC wins on speed, streaming and typed contracts — the right default for high-performance internal microservices. Choose by your callers and your traffic, and don't be afraid to run both.