TL;DR
REST, GraphQL, and gRPC solve the same problem three ways. Compare them on payload, streaming, caching, and tooling — and pick by caller and team, not fashion.
Every new service eventually faces the same question: how do clients talk to it? REST is the default most teams reach for, GraphQL is the answer when clients keep asking for different shapes of the same data, and gRPC is the answer when services talk to each other at volume. They are not three versions of the same idea. They are three different contracts — a resource URL, a client-shaped query, and a generated function call — and the right one depends on who calls the API, what the payload looks like, and how big the team is.
The three styles have settled histories, so the decision can rest on facts rather than fashion. REST comes from Roy Fielding's 2000 dissertation, Architectural Styles and the Design of Network-based Software Architectures, which defined the resource-oriented, stateless, cacheable style the web already ran on. GraphQL was created at Facebook in 2012, open-sourced in September 2015, and is now governed by the GraphQL Foundation; its specification reached the September 2025 edition — the first tagged edition since October 2021 — and it deliberately standardises only the query language, type system, and execution semantics, leaving transport and caching to implementations. gRPC was open-sourced by Google in 2015, runs on HTTP/2 with Protocol Buffers, and is under active development — gRPC Core 1.85 shipped in October–November 2026. The short version up front: pick REST when the API is public and cacheable, GraphQL when many different clients need different slices of the same data, and gRPC when your own services call each other. Everything below is the reasoning that makes those three sentences true.
REST: the resource contract
REST models the world as resources with URLs, and uses HTTP itself as the interface: GET /orders/42 reads one, POST /orders creates one, PATCH /orders/42 changes part of one. The contract is the URL space plus the media type, and the server decides the shape of every response. That is both its strength and its limit — the shape is fixed, so clients get what the server sends, whether they need all of it or not.
# One resource, one round trip — but the server fixes the shape curl https://api.example.com/orders/42 \ -H "Authorization: Bearer <token>"
{
"id": 42,
"customer": { "id": 7, "name": "Asha", "tier": "gold" },
"items": [
{ "sku": "KB-100", "qty": 2, "price": 49.99 },
{ "sku": "MS-220", "qty": 1, "price": 29.99 }
],
"total": 129.97,
"status": "shipped",
"tracking": { "carrier": "UPS", "number": "1Z999AA10123456784" }
}A mobile client that only wants the status and the tracking number still downloads the customer record, both line items, and the total. That is over-fetching, and the standard fix is more endpoints or query parameters (?fields=status,tracking) — which is, quietly, rebuilding a query language on top of REST. The opposite problem, under-fetching, is worse: a screen that needs an order, its customer, and its shipment makes three round trips unless the API offers an aggregate endpoint. REST's honest answer to both is that the server owns the shape, and clients adapt.
What REST gives you in exchange is the whole HTTP ecosystem, free. Responses are cacheable with Cache-Control and ETag — a CDN can serve GET /orders/42 without ever reaching your origin, and a browser can cache it the same way. Any HTTP client in any language works with no code generation and no schema tooling. Errors are HTTP status codes, which every load balancer, proxy, and monitoring tool already understands. And because the contract is just URLs and JSON, versioning is a visible, explicit decision: a new URL version, a new media type, or additive fields. The cost is discipline: nothing in REST stops a team from shipping fifty ad-hoc endpoints with inconsistent shapes, and the OpenAPI document that is supposed to describe them is a separate artifact that drifts from the code unless it is generated from it.
REST is for: public and partner APIs, anything a CDN should cache, teams that want the lowest possible tooling burden, and APIs whose consumers are unknown — because the contract is the web itself, and every client already speaks it.
GraphQL: the client-shaped query
GraphQL inverts the contract. Instead of the server fixing the response shape, the client sends a query describing exactly the fields it wants, and the server executes it against a typed schema. One endpoint, one request, no over-fetching and no under-fetching — the mobile screen asks for status and tracking, the admin screen asks for everything, and both hit the same endpoint.
# The client picks the fields — the server fills in exactly those
query OrderStatus($id: ID!) {
order(id: $id) {
status
tracking {
carrier
number
}
}
}# The schema is the contract: types, fields, and what each one costs
type Order {
id: ID!
status: OrderStatus!
total: Float!
customer: Customer!
items: [OrderItem!]!
tracking: Tracking
}
type Query {
order(id: ID!): Order
}The schema is GraphQL's real product. It is a typed, introspectable description of everything the API can do, which is why the tooling around it is so good: clients generate typed hooks from the schema, the playground documents itself, and a breaking change is a schema change you can detect in CI rather than a runtime surprise. Schema evolution is additive by design — add a field, deprecate an old one — so the API can grow without version numbers. That is also the reason GraphQL fits organisations with many clients: one schema serves the web app, the iOS app, and the internal dashboard, each taking the slice it needs.
The costs are real and they are all on the server side. A query is a program, and a program can be expensive: a deeply nested query (customer.orders.items.product.reviews...) can fan out into hundreds of database calls — the N+1 problem — unless resolvers batch and cache their loads, which is what the DataLoader pattern exists for. Caching is the second cost: because every request is a POST to one endpoint with a different body, HTTP caching mostly does not apply, so teams cache at the client (a normalised cache in Apollo Client or Relay) or adopt persisted queries so identical operations get stable ids a CDN can key on. And a single GraphQL endpoint is a single point of failure for every client, so its availability, rate limiting, and query-complexity limits have to be engineered, not assumed. Federation — composing one graph from many teams' subgraphs, as in Apollo Federation — solves the organisational scaling problem, but it is a second system to operate.
GraphQL is for: many different clients over one API, screens with varied data needs, mobile clients on slow networks where every byte and every round trip counts, and organisations willing to operate a graph layer in exchange for client freedom.
gRPC: the typed contract
gRPC treats an API as a function call. Services and messages are defined in a .proto file, and the tooling generates a typed client and server stub in every supported language. Calls run over HTTP/2 — multiplexed streams on one connection, header compression, bidirectional streaming — and messages are encoded as Protocol Buffers, a compact binary format that is usually smaller on the wire than the equivalent JSON. The contract is the .proto file, and it is enforced by the compiler: if the client and server disagree, the build fails instead of the request.
// order.proto — the contract, shared by every language
syntax = "proto3";
package orders;
service OrderService {
rpc GetOrder(GetOrderRequest) returns (Order);
rpc StreamOrderEvents(StreamOrderEventsRequest)
returns (stream OrderEvent);
}
message GetOrderRequest {
string id = 1;
}
message Order {
string id = 1;
string status = 2;
double total = 3;
}// The generated stub makes the call feel like a local function
import { OrderServiceClient } from './generated/orders.client';
const client = new OrderServiceClient('orders.internal:50051');
const order = await client.getOrder({ id: '42' });
console.log(order.status, order.total);
// Streaming is a first-class call shape, not a bolt-on
for await (const event of client.streamOrderEvents({ orderId: '42' })) {
console.log(event.type, event.at);
}Four call shapes come with the framework — unary, server streaming, client streaming, and bidirectional streaming — and they are the reason gRPC dominates service-to-service traffic: a service can push a live event stream to another service with no polling, no WebSocket server to build, and no second protocol. Deadlines and cancellation propagate across the call chain, so a timeout at the edge cancels work deep inside the system instead of letting it run to completion unobserved. And because the interface is generated, renaming a field or changing a type is a compile-time event in every consumer.
The costs are the mirror image of REST's strengths. gRPC is a poor fit for browsers: browsers cannot speak native gRPC directly, so a browser client needs grpc-web or a gateway that translates to REST or JSON — an extra hop and an extra component. The binary wire format is not human-readable, so debugging means decoding with a tool rather than reading a curl response, and HTTP-level tooling (CDNs, caches, most API gateways) does not understand it — you need an HTTP/2-aware load balancer and a proxy that speaks gRPC, which is why the style pairs naturally with a service mesh. Versioning is disciplined but strict: fields are numbered, old numbers are never reused, and removing a field is a breaking change that the compiler will not catch for you if the old number is recycled. And the whole approach assumes the team controls both ends of the call — gRPC is a contract between services you own, not an invitation to the public internet.
gRPC is for: service-to-service calls inside one organisation, high-volume or latency-sensitive traffic, streaming workloads (live events, telemetry, chat), and polyglot systems where generated stubs in ten languages beat hand-written clients.
Head-to-head: REST vs GraphQL vs gRPC
| REST | GraphQL | gRPC | |
|---|---|---|---|
| Contract | URL space + media type | Typed schema (SDL) | .proto service definition |
| Transport | HTTP/1.1 (HTTP/2 optional) | HTTP, usually HTTP/2 | HTTP/2, mandated |
| Payload | JSON (or XML) | JSON | Protocol Buffers (binary) |
| Client decides shape? | No — server fixes it | Yes — query picks fields | No — stub signature fixes it |
| Round trips for a screen | Often several | One | One per call |
| Streaming | SSE / WebSocket bolt-ons | Subscriptions | Native: four call shapes |
| Caching | HTTP caching, CDNs — free | Client normalised cache, persisted queries | None at HTTP layer |
| Browser support | Native | Native | Needs grpc-web or a gateway |
| Code generation | Optional (OpenAPI) | Client types from schema | Client + server stubs from .proto |
| Versioning | URL / media type versions | Additive fields + deprecation | Field numbers, never reuse |
| Debugging | curl, readable JSON | Playground, readable JSON | Binary — needs decoding tools |
| Best for | Public, cacheable APIs | Many varied clients | Service-to-service at volume |
The table hides the decision that matters most, which is not in any row: who owns the change. With REST, the server owns the shape and clients adapt; with GraphQL, clients own the shape and the server adapts; with gRPC, the contract owns the shape and both sides compile against it. Pick the ownership model that matches your organisation. A public API cannot let clients dictate the shape, so REST. A product with five clients and one backend team cannot afford five hand-built endpoints, so GraphQL. Ten services owned by ten teams cannot afford hand-written clients in ten languages, so gRPC.
Two other factors decide more real-world choices than any row of the table. The first is team size and skill: GraphQL's server-side costs (batching, query-complexity limits, federation) need a team that will operate a graph layer, and gRPC's tooling needs a team comfortable with code generation and HTTP/2-aware infrastructure. A two-person team shipping a public API should take REST and spend the saved effort on the product. The second is the traffic pattern: if the dominant call is a browser loading a page, REST or GraphQL; if it is a service calling another service a thousand times a second, gRPC; if it is a live feed, gRPC streaming or GraphQL subscriptions — and note that REST has no native answer there at all.
Architecture decision: API style for a new service
Recommendation
For a new service, apply the decision in this order. First, ask who calls it. If the callers are third parties, partners, or browsers hitting a CDN — REST, with an OpenAPI document generated from the code so it cannot drift. If the callers are your own apps and they keep asking for different slices of the same data — GraphQL, with query-complexity limits and DataLoader-style batching from day one, not added after the first incident. If the callers are your own services — gRPC, with deadlines set on every call and field numbers treated as permanent.
Second, put a gateway in front of whichever style you pick. A gateway is where authentication, rate limiting, and request logging live once instead of in every service — our service mesh vs API gateway guide covers which one belongs where, and the same gateway is what translates gRPC to REST for browser clients when you need it. Third, decide the versioning story before the first client ships: additive fields and deprecation for GraphQL, field-number discipline for gRPC, and an explicit URL or media-type version for REST — because the first breaking change is when you discover whether you had a versioning story at all.
For an existing service, the migration is incremental and safe. A REST API can grow a GraphQL layer in front of it: resolvers call the same handlers the REST endpoints call, and clients migrate one screen at a time — the REST endpoints stay live until the last client moves. A REST service can grow gRPC behind it: the service-to-service calls move to stubs while the public REST surface stays untouched. What you should not do is a big-bang rewrite of the API style, because the style is the contract, and every client has to move on the same day. Migrate the callers, not the contract, and retire the old surface only when its traffic is gone.
When NOT to use each
?fields= parameter list, you are rebuilding GraphQL badly. The ?fields= endpoint has no schema, no tooling, and no type safety — it is the worst of both styles.curl debugging, no API gateway that understands the calls without specific support. A public API should be readable and cacheable — that is REST's job.REST, GraphQL, and gRPC are not rungs on a ladder — nothing is "more modern" about any of them, and the team that picks gRPC for a public API or GraphQL for service-to-service calls has mistaken novelty for fit. The durable skill is reading the caller pattern: public and cacheable, many clients with different needs, or services talking to services. Name the callers first, and the style picks itself. For the decision that comes before this one — how the services themselves are organised — our modular monolith vs microservices guide is the place to start; and when the answer to "which API style" is "none of them, this should be asynchronous", our event-driven microservices guide covers the queue-and-event alternative.
Why This Matters
Understanding the business and technical context helps you make informed decisions rather than blindly following patterns.
Trade-offs to Consider
Every architectural decision involves trade-offs. Consider your specific requirements, team expertise, and scale when evaluating options.
When NOT to Use This
Knowing when a solution doesn't apply is as valuable as knowing when it does. Consider alternatives for your specific situation.
Decision Framework
Use this framework to evaluate whether this approach is right for your use case based on your specific constraints and requirements.