Three Common Styles
REST, gRPC, and GraphQL solve overlapping problems with different trade offs. There is no single winner, only a fit for a context.
How They Differ
Each style makes a different bet on encoding and shape.
- REST uses text over HTTP with resource URLs and verbs, easy to cache and explore.
- gRPC uses binary over HTTP version two with a strict contract and streaming, fast for internal calls.
- GraphQL uses a single endpoint where clients shape their own queries.
Picking One
The choice follows who calls the API and how.
- For public web APIs that browsers and many clients hit, REST is simple and cacheable.
- For internal service to service traffic that values speed and streaming, gRPC fits well.
- For rich clients with varied data needs, such as mobile screens, GraphQL avoids many round trips.
The Honest Trade Offs
Each gain has a cost.
- gRPC is fast but not browser friendly without a proxy, and traffic is opaque.
- GraphQL is flexible but pushes cost and caching complexity to the server.
- REST is universal but can cause over fetching and chatty calls.
Many real systems mix them, exposing REST or GraphQL at the edge and gRPC between internal services.
Key idea
REST, gRPC, and GraphQL trade off caching, speed, and query flexibility, so the right pick follows the callers, and many systems combine REST or GraphQL at the edge with gRPC between internal services.