REST, GraphQL and RPC
Same question, three styles
The phone app needs garden 7 and its plants. There are three popular styles for asking a server, and each asks differently.
REST, GraphQL and RPC
- RESTEach thing has its own URL, and HTTP verbs say what to do: GET /gardens/7, then GET /gardens/7/plants.
- GraphQLOne URL for everything. The app sends a query that names exactly the fields it wants.
- RPC (gRPC)The app calls a function on the server as if it were its own: GetGarden(7). gRPC sends Protocol Buffers, a compact binary format.
Quick check
Which style lets the phone ask for exactly the fields it needs in one request?
- GraphQL
- REST
- None of them
Show the answer
GraphQL
GraphQL's site says it lets you "request exactly the data you need". REST returns each URL's whole shape, which can take several requests.
Read the query
1query {2 garden(id: 7) {3 name4 plants { kind health }5 }6}
What comes back?
- The garden's name and each plant's kind and health, nothing else
- Every field the garden has
- Only the plants
Show the answer
The garden's name and each plant's kind and health, nothing else
A GraphQL answer has the same shape as the query. Fields the query does not name are not sent.
The trade-offs
REST is simple, and each URL can be cached by a CDN. GraphQL saves round trips, but a GraphQL server "operates on a single URL/endpoint, usually /graphql", so caching and rate limits need more thought. gRPC's typed binary messages are compact, a good fit for calls between servers.
Quick check
A GraphQL API usually answers every query at one URL.
- True
- False
Show the answer
True
GraphQL's own guide says a server operates on a single endpoint, usually ending in /graphql, and every request goes there.
Shard Garden's choice
REST for public things many players read, like garden pages and the leaderboard, because a CDN can cache them. gRPC between the studio's own servers, like a match server reporting a result to the save service. Remy records the choice in a decision record.
Pick the style
The leaderboard is read by millions and changes once a minute. Which style should Remy pick so a CDN can cache it?
- REST: GET /leaderboard is one URL a CDN can keep a copy of
- GraphQL: one endpoint for every query
- gRPC: compact binary messages
Show the answer
REST: GET /leaderboard is one URL a CDN can keep a copy of
A CDN caches by URL. One stable URL with the same answer for everyone is exactly what a CDN is good at.
Not every job needs an answer now
Some work, like emailing every player, is too slow to do while a player waits for an answer.
Bolt says: Next: queues and background jobs.
Fact-checked 12 October 2026
- GraphQL: Serving over HTTP graphql.org
- gRPC: Introduction grpc.io