All three let a client and a server talk over the network β they just disagree on how. REST exposes resources over plain HTTP; GraphQL lets the client ask for exactly the data it wants from one endpoint; gRPC makes fast, typed, binary remote-procedure calls between services.
Resources over HTTP
π REST
Simple, universal, cacheable. The default for public web APIs.
Ask for what you need
π· GraphQL
One endpoint, a typed query β no over- or under-fetching.
Fast typed RPC
β‘ gRPC
Binary Protobuf over HTTP/2 with streaming. Built for microservices.
One line each. REST: "GET this resource." GraphQL: "here's exactly the shape of data I want." gRPC: "call this function on that service, fast."
At a glance The request, three ways
Fetching a user and their orders looks different in each β and that difference is the whole story:
REST's multiple round trips and fixed responses (over-fetching) are exactly what GraphQL set out to fix; gRPC instead optimizes for raw speed and typed contracts between services.
Style 1 REST
REST Representational State Transfer Β· JSON over HTTP
Solves Simple, universal client-server APIs. Model your domain as resources with URLs (/users/1) and act on them with HTTP verbs (GET/POST/PUT/DELETE). It's stateless, human-readable JSON, works with every language and browser, and gets HTTP caching for free.
Limits Fixed endpoints cause over-fetching (you get fields you don't need) and under-fetching (you make several calls to assemble one screen). No enforced schema unless you add OpenAPI; versioning (/v2/) and evolving responses can get messy.
Choose Public APIs, CRUD services, and anything valuing simplicity, broad tooling, and HTTP caching.
Style 2 GraphQL
GraphQL query language for APIs Β· one endpoint, typed schema
Solves Over- and under-fetching. The client sends a query to a single endpoint describing exactly the fields and nested relations it wants, and gets back that shape β in one request. A strongly-typed schema documents the whole API, and one graph can aggregate several backend sources.
Limits More server complexity; HTTP caching is harder (one endpoint, usually POST). It's prone to the N+1 query problem, and arbitrary client queries create cost/security concerns (deep or expensive queries need depth-limiting and rate control). File uploads and simple cases can feel heavyweight.
Choose Rich, nested data; many clients with different needs (web + mobile); aggregating multiple services; when eliminating over/under-fetching matters.
Style 3 gRPC
gRPC RPC framework Β· Protocol Buffers over HTTP/2
Solves Fast, strongly-typed service-to-service communication. You define the service contract-first in a .proto file; gRPC generates typed clients/servers in many languages, serializes with compact binary Protobuf, runs over HTTP/2, and supports streaming (client, server, and bidirectional) as a first-class feature.
Limits Not natively callable from browsers (needs gRPC-Web + a proxy). The binary payloads aren't human-readable, tooling/debugging has a learning curve, and it's overkill for simple public CRUD APIs.
Choose Internal microservices, low-latency / high-throughput links, streaming, and polyglot systems that want one typed contract.
Concretely Same data, three styles
Fetch a user and their orders. Switch tabs; hit Copy.
get a user + their orders
# REST: one resource per endpoint β often several round trips.
GET /users/1 # β { id, name, email, address, ... } (may over-fetch)
GET /users/1/orders # β [ { id, total, ... }, ... ] (a second call)# JSON, cacheable via standard HTTP caching. No enforced schema by default.
# GraphQL: one request to one endpoint, asking for EXACTLY these fields.
query {
user(id: 1) {
name
orders {
id
total
}
}
}
# β { "user": { "name": "...", "orders": [ { "id": 1, "total": 42 } ] } }
// gRPC: define the contract first; codegen makes typed clients/servers.
service UserService {
rpc GetUser (UserRequest) returns (User);
rpc WatchOrders (UserRequest) returns (stream Order); // server streaming
}
message UserRequest { int32 id = 1; }
message User { int32 id = 1; string name = 2; }
message Order { int32 id = 1; double total = 2; }
Side by side
Aspect
REST
GraphQL
gRPC
Model
Resources + HTTP verbs
One endpoint, typed queries
Remote procedure calls
Payload
JSON (text)
JSON (text)
Protobuf (binary)
Transport
HTTP/1.1 (usually)
HTTP
HTTP/2
Contract
Optional (OpenAPI)
Required schema
Required .proto
Fetching
Fixed per endpoint (over/under-fetch)
Client picks exact fields
Method call
Streaming
Bolt-on (SSE/WebSocket)
Subscriptions
First-class, bidirectional
Performance
Good
Good
Best (binary + HTTP/2)
Browser
Native
Native
Needs gRPC-Web + proxy
Caching
Easy (HTTP)
Harder
Custom
Best for
Public / CRUD APIs
Complex, nested, many clients
Internal microservices
When to choose which
If youβ¦
Reach forβ¦
Build a public API valuing simplicity & caching
REST
Do straightforward CRUD with broad client support
REST
Serve many clients needing different slices of nested data
GraphQL
Want to kill over/under-fetching & aggregate sources
GraphQL
Connect internal microservices with low latency
gRPC
Need streaming or a typed polyglot contract
gRPC
They coexist. A very common architecture: gRPC between internal services for speed, with a REST or GraphQL gateway at the edge for browsers and third parties. Pick per boundary, not once for everything.
Cheat sheet
Question
Short answer
One-liner for each?
REST = resources over HTTP; GraphQL = ask for exact data; gRPC = fast typed RPC.
What problem did GraphQL fix in REST?
Over- and under-fetching (and multiple round trips).
Why is gRPC fast?
Binary Protobuf over HTTP/2, with streaming.
Which struggles in the browser?
gRPC β needs gRPC-Web + a proxy.
Which caches most easily?
REST, via standard HTTP caching.
Must I pick just one?
No β gRPC internally, REST/GraphQL at the edge is common.
Knowledge check
Six questions on REST, GraphQL and gRPC. Pick an answer for each, then check your score.
Next steps
π APIs vs MCP
APIs meet AI β how these API styles get exposed to agents via MCP.
π n8n automation
Call any API β the HTTP node wires REST/GraphQL endpoints into workflows.