| Aspect | GraphQL | gRPC |
|---|---|---|
| Purpose | Query language for client-facing APIs (web, mobile) | RPC framework for calling methods between services |
| Transport and format | Usually HTTP/JSON | HTTP/2 and Protocol Buffers (binary) |
| Contract | GraphQL SDL schema, introspection | .proto files, generated clients and servers |
| Performance | Adequate, but N+1 and complex queries need control | High: compact binary format and multiplexing |
| Streaming | Subscriptions (usually WebSocket) | Built-in bidirectional streaming |
| Browser | Works natively | Needs grpc-web and a proxy |
| Maintainer | GraphQL Foundation (Linux Foundation), created at Meta in 2015 | Google, a CNCF project, 2015 |
| Best for | Public or client-facing API with varied data needs | Internal microservices, low latency, polyglot teams |
Choose GraphQL when
- Several clients need different sets of fields.
- You want fewer requests over mobile networks.
- You need a flexible aggregation layer over many sources.
Choose gRPC when
- Services in different languages talk to each other.
- Speed and strict contracts matter.
- You need bidirectional streaming.
Bottom line
They rarely compete: GraphQL sits between clients and the backend, gRPC between internal services. For a simple CRUD API plain REST is often simpler than both.
Compared
Logos belong to their owners and are used for identification only. Icons: Simple Icons (CC0), Devicon (MIT).