APIs · Beginner · 16 min
Choose between REST, GraphQL and gRPC for your API
By Padding · Updated 18 Nov 2026
A text editor or shared document for the decision record · November 2026
You will choose an API style for three real scenarios by weighing who calls each API, caching, browser support, payload size, streaming, tooling and team skills, and record each choice in a one-page decision record.
On this page
REST, GraphQL and gRPC are three ways to let one program ask another for data or ask it to do something. None of them is the modern one or the old one. Each was built for a different kind of caller, and each makes some things cheap and other things expensive. Teams get into trouble when they pick the style a conference talk praised and then spend a year working around it.
In this tutorial you make the choice the slow way, once, so you can make it quickly afterwards. You work through a fictional delivery company, Tarpaulin Freight, which needs three APIs:
- a partner API that online shops use to book deliveries and check their status
- a customer app API for its Android and iPhone app, which has a dozen screens
- an internal API between its tracking service and its pricing service
For each one you list who calls it, compare the three styles on seven factors, pick one, and write a short decision record your team can read in a year's time. Nothing here needs code or an account. You need a document to write in.
Step 1 · Write down who calls each API
The single biggest factor is the caller, because it fixes what the other side can run and how much you can ask of them. Start a document called api-style-decisions and give each API a heading. Under each, answer four questions in a sentence each:
- Who writes the client code? Your own team, a partner's team, or anyone on the internet.
- Where does the client run? A browser, a mobile app, a server, or a mix.
- Can you change every client at once? You can redeploy your own services together. You cannot force a partner or an installed app to update.
- What network sits between them? A data centre network, home broadband, or mobile data that may be slow, metered and prepaid.
For Tarpaulin Freight the answers look like this:
- Partner API: written by developers at other companies, in any language, mostly on servers. You cannot change their code. Normal internet links.
- Customer app API: written by Tarpaulin's own mobile team. Runs on phones, many of them low-cost Android handsets on prepaid mobile data in Lagos, Nairobi and Accra, where every megabyte is paid for. Old app versions stay installed for months.
- Internal API: written by Tarpaulin's backend team on both sides. Runs in the same data centre. Both services deploy from the same pipeline. Thousands of calls a second.
Check it worked
Your document has three headings, and under each one there are four plain answers. If any answer says "it depends" or "everyone", narrow it: name the most important caller and write the others as a second line.
Step 2 · Compare what a request looks like in each style
Before you weigh factors, picture the same question asked three ways: "where is delivery D-1042 and who is driving it?"
- REST gives each thing its own URL and uses HTTP methods to act on it. The server decides which fields a response contains. Because a
GETnames one resource by URL, browsers, proxies and CDNs can cache it with standard HTTP headers. The cost: a screen that needs a delivery and its driver may need two requests, or a special endpoint. - GraphQL puts one endpoint in front of a typed schema. The client sends a query listing exactly the fields it wants, across related objects, and gets back JSON in the same shape. One request replaces several. The cost: most queries travel as
POSTto the same URL, so ordinary HTTP caches cannot tell them apart, and a response can contain bothdataand anerrorslist, so "HTTP 200" does not mean "everything worked". - gRPC turns the API into methods on a service, defined in a
.protofile. Both sides generate code from that file, so a call looks like a local function call with typed arguments. Messages travel as compact binary Protocol Buffers over HTTP/2, and a method can stream many messages in either direction. The cost: browsers cannot speak gRPC directly, and you cannot read a message withcurland your eyes.
Check it worked
Under your three API headings, write one line each answering: "how many requests does the most common screen or task need in each style?" For the customer app's delivery screen, REST is two (or one with a custom endpoint), GraphQL is one, gRPC is one but needs gRPC-Web in a browser. If you cannot answer, go back to the diagram.
Step 3 · Score the seven factors that decide it
Now judge each style against each factor for one API at a time. Use three marks: good fit, workable, poor fit. Write a reason next to each mark; a mark without a reason is a guess.
The factors, and what each style does with them:
- Callers. REST asks least of an outside developer: any language with an HTTP client works, and
curlis enough to try it. GraphQL needs the caller to learn your schema and query language, which pays off for a team building many screens. gRPC needs the caller to compile your.protofile into their language, which is fine when you own both sides. - Caching. REST
GETresponses work withCache-Control,ETagand304 Not Modified, so a CDN or the phone's own HTTP cache can answer repeat requests without reaching your server. GraphQL usually caches inside the client library, keyed by object type and id. Sending queries byGETwith a persisted query hash brings HTTP caching back, but you have to set it up. gRPC has no standard HTTP caching; you cache in your own code. - Browser support. REST and GraphQL are ordinary HTTP and work from any browser. gRPC from a browser needs gRPC-Web and a proxy that translates it, and gRPC-Web supports only unary and server-streaming calls.
- Payload size. Binary Protobuf messages are smaller than the same data in JSON and quicker to parse. GraphQL trims payloads differently: the client never receives fields it did not ask for. REST responses carry whatever the server includes, which can be generous; compression and sparse field options help.
- Streaming. gRPC has streaming built in, in both directions. GraphQL defines subscriptions, but the transport (WebSockets or server-sent events) is left to you and your libraries. REST can stream one way with server-sent events, or hand off to webhooks for "tell me when it changes" across companies.
- Tooling and contracts. REST has OpenAPI for describing endpoints, generating reference docs and client libraries. GraphQL has a schema the server can describe about itself, which powers editor autocomplete and type generation. gRPC's
.protofile is the contract and the code generator in one. - Team skills. Count who already runs each style in production. A style nobody on the team has debugged at three in the morning carries a real cost for the first year: monitoring, error handling, security reviews and load testing all need relearning.
For the partner API, a first pass might read: callers, REST good fit (any language, curl), GraphQL workable, gRPC poor fit (partners must compile your .proto).
Check it worked
Each of your three APIs has seven factor lines, each with a mark for all three styles and a reason. Scan for any factor where all three styles score the same: that factor does not decide this API, so strike it through. You should be left with two to four factors per API that actually separate the options.
Step 4 · Decide for the public partner API
Read your remaining factors for the partner API. For Tarpaulin Freight, three stand out:
- Callers are strangers using whatever language their shop runs on. The style with the lowest learning cost wins, and that is REST: a developer can read an example request, run it with
curland see JSON. - Tooling matters because partners need reference docs and, ideally, generated client libraries. An OpenAPI document gives both.
- Streaming looked like a gap ("tell me when a delivery's status changes"), but partners run servers, so webhooks solve it: Tarpaulin calls the partner's URL when a status changes. That is simpler for partners than holding a connection open.
GraphQL would work, and some public APIs offer it as an extra. It would also make Tarpaulin responsible for protecting itself from expensive queries written by strangers, which needs query depth and cost limits. With no screen-by-screen needs on the partner side, that cost buys nothing.
Write the decision under the partner API heading: REST, described with OpenAPI, with webhooks for status changes.
Check it worked
Your decision names the style and the one or two factors that decided it. Then write the strongest argument against it in one sentence (for example: "partners who list 500 deliveries make many small requests"), and how you will handle it ("a list endpoint with cursor pagination"). If you cannot think of a counter-argument, ask a colleague to argue for GraphQL for two minutes.
Step 5 · Decide for the mobile app with many screens
The customer app has different callers and a different network. The factors that separate the options:
- Callers are Tarpaulin's own mobile team, who can learn a schema once and use it on every screen.
- Payload size and round trips matter because many customers are on prepaid mobile data and low-cost Android phones. A tracking screen that needs a delivery, its driver, the last three location updates and the delivery fee could take four REST requests, and on a slow mobile link each extra round trip adds noticeable delay (more if the app waits for one response before it can make the next request). One GraphQL query fetches exactly those fields in one round trip.
- Old app versions stay installed for months. Adding fields is safe in both styles. GraphQL also shows you which fields old app versions still request and lets you mark a field
@deprecatedin the schema before removing it, where REST usually needs a new version or endpoint to change or remove a field. - Caching is the weak spot. Because queries are usually
POST, repeat requests are not served by HTTP caches. Persisted queries help with caching and with request size: the app sends a short hash instead of the full query text, which saves bytes on every request and allowsGETwith cache headers.
gRPC scored well on payload size, and some native apps do use it. Here the team also plans a web version of the tracking page, and gRPC-Web adds a proxy to run. REST with a few screen-specific endpoints (often called a backend for frontend) is a real alternative, and the right one if the team has no GraphQL experience and only three screens.
Write the decision: GraphQL for the customer app, using persisted queries, with query cost limits on the server.
Check it worked
Pick the app's busiest screen and write the fields it needs as a list. Count the requests that list takes in REST as the partner API is designed, and in GraphQL. If REST already serves the screen in one request, your reason for GraphQL is weaker than you thought; say so in the record. A note for low-data users: whichever style you choose, measure the bytes a screen downloads on a real phone on mobile data, not on office Wi-Fi.
Step 6 · Decide for service-to-service calls
The internal tracking-to-pricing API is the opposite of the partner API on almost every line:
- Callers are Tarpaulin's own services, deployed together, so a shared
.protofile and generated code cost nothing extra and catch mismatched fields at build time instead of in production. - Volume is thousands of calls a second. Compact binary messages over long-lived HTTP/2 connections cut CPU and bandwidth compared with parsing JSON on every call.
- Streaming is real: the tracking service pushes a continuous flow of location updates for the pricing service to re-estimate arrival times and fees. A gRPC server-streaming or bidirectional method models that directly.
- Deadlines matter between services. A gRPC client sets how long it will wait, and the deadline travels with the call, so a slow pricing service does not hold up tracking indefinitely.
- Browser support does not matter, because no browser is in the path.
What you give up is reading messages by eye. Plan for it: use tools such as grpcurl and server reflection in development, and log decoded messages, not raw bytes.
Write the decision: gRPC between tracking and pricing, with deadlines on every call.
Check it worked
Look at your three decisions side by side. You should see three different styles, and each decision should trace back to the caller you wrote down in the first step. If one company ending up with three styles feels wasteful, write down which one you would drop and what that API loses. This is the cost you are agreeing to pay.
Step 7 · Write a decision record for each choice
A decision without its reasons gets reopened every time someone new joins. A short architecture decision record (ADR) stops that. Copy this template into your document once per API and fill it in:
# ADR 007: API style for the customer app
Status: Accepted, 2026-11-18
Deciders: <names or roles>
## Context
Who calls it, where they run, whether we control every client, the network.
The two to four factors that separated the options, with the reason for each.
## Decision
GraphQL, with persisted queries and query cost limits.
## Options considered
- REST with screen-specific endpoints: rejected because <reason>.
- gRPC with gRPC-Web: rejected because <reason>.
## Consequences
What gets easier. What gets harder. What we must build or learn first.
## Revisit when
A condition that would change the answer, such as "a web client becomes
the main caller" or "we open this API to partners".Keep each record to one page. The Revisit when line matters most: it tells a future reader whether the reasons still hold, so they can change the decision without guessing what you were thinking.
Check it worked
You have three records, each with a status and date, at least two rejected options with reasons, and a "Revisit when" condition that someone could actually check. Give one record to a colleague who was not involved and ask them to explain the choice back to you in two sentences. If they cannot, the Context section is missing a reason.
Next steps
You have a method: name the caller, picture the request, score the factors that separate the options, decide, and write it down. Now build each style:
- Design the partner API properly in Design REST endpoints: resources, methods and status codes, then describe it in Describe an API with an OpenAPI 3.2 document.
- Build a schema and resolvers in Build a GraphQL API with Apollo Server.
- Write a
.protofile with a streaming method in Build a gRPC service and client with Protocol Buffers.
Part of these paths
Related tutorials
- Design REST endpoints: resources, methods and status codesYou will design the endpoints of an event ticketing API on one page, build an Express 5 stub that follows it, and prove every status code in the design with curl.
- Build your first GraphQL API with Apollo ServerYou will have a GraphQL API for authors and books on Apollo Server 5.5 and Node.js 26, with a mutation that rejects bad input, batched database calls through DataLoader, a query depth limit, and a clear idea of what it costs to run.
- Build a gRPC service and client with Protocol BuffersYou will define a stock-price service in a .proto file, run it with @grpc/grpc-js 1.14 on Node.js 26 with a one-off call and a streaming call, handle deadlines and status codes, inspect it with grpcurl, and add a field without breaking older clients.
Need this done for you?
Padding does this work for growing companies, from the first diagnosis to a system that keeps working.
Get new tutorials