REST vs GraphQL vs gRPC: choosing an API style

REST, GraphQL and gRPC compared on performance, caching, tooling, security and team effort, with picks for public, mobile and internal APIs.

INDI TECHNOLOGY4 min read

API style debates often turn into arguments about taste. In practice, each style fits different situations well, and many systems use more than one: REST for public and partner APIs, GraphQL for complex client apps, gRPC between internal services.

At a glance

REST GraphQL gRPC
Model Resources over HTTP verbs One endpoint; clients query exactly the fields they need Remote procedure calls defined in Protocol Buffers
Format JSON (usually) JSON Binary (Protobuf)
Transport HTTP/1.1 or 2 HTTP HTTP/2
Contract OpenAPI (optional but recommended) Schema (required) .proto files (required)
Caching Excellent: HTTP and CDN caching Harder; needs client or persisted-query caching Not HTTP-cacheable; application-level
Over- and under-fetching Common Solved Defined by method
Streaming Server-sent events or websockets separately Subscriptions Built-in, bidirectional
Browser support Native Native Needs gRPC-Web or a proxy
Learning curve Lowest Moderate Moderate
Best fit Public, partner and most product APIs Rich clients pulling data from many sources Service-to-service, low latency, high volume

REST: the default

REST is understood by every developer, every tool and every partner. It works with HTTP caching, CDNs, API gateways, rate limiters and logging out of the box. With an OpenAPI specification you get documentation, client SDKs and contract tests.

Watch out for: chatty clients making many calls to build one screen, and inconsistent design across teams. Fix the first with a few purpose-built endpoints or a backend-for-frontend; fix the second with an API style guide.

Use it for: public APIs, partner integrations (banks, payment providers and logistics partners all expect REST and webhooks), and most product APIs.

GraphQL: flexible data for complex clients

With GraphQL, a mobile app can request exactly the fields a screen needs from many related objects in one round trip. Frontend teams can build new screens without waiting for new backend endpoints. The schema is strongly typed and self-documenting.

Costs:

  • Caching doesn't work with plain HTTP caching; use client caches (Apollo, Relay, urql) and persisted queries.
  • Performance traps: naive resolvers cause N+1 database queries. Use batching (DataLoader) from day one.
  • Security: clients can write expensive queries. Limit query depth and complexity, and use persisted queries for public clients.
  • Authorisation must be enforced per field or per object, not just per endpoint.

Use it for: products with several rich clients (web, iOS, Android) showing data from many sources, and federated APIs in large organisations.

gRPC: fast service-to-service calls

gRPC uses binary Protocol Buffers over HTTP/2. It's compact and fast, supports streaming in both directions, and generates strongly typed clients in many languages from .proto files. Contracts are strict, which catches breaking changes early.

Costs: it isn't human-readable without tools, isn't directly usable from browsers (needs gRPC-Web or a gateway), and needs HTTP/2-aware load balancing.

Use it for: internal microservice calls, high-volume or low-latency paths (pricing, risk scoring, ML inference), streaming data, and polyglot systems where generated clients save time.

Performance in context

gRPC is typically faster and uses less bandwidth than JSON over REST, which matters for chatty internal calls and mobile networks. For a typical product API, though, the database and business logic dominate response time, and well-designed REST is fast enough. Measure before switching styles for speed.

Choose REST if…

  • the API is public or used by partners
  • you want caching, CDNs and standard tools to just work
  • the team wants the simplest, most familiar option

Choose GraphQL if…

  • you have multiple rich client apps with fast-changing screens
  • data comes from many services and clients need flexible combinations
  • you'll invest in batching, query limits and field-level authorisation

Choose gRPC if…

  • services call each other frequently inside your platform
  • you need streaming or very low latency
  • services are written in several languages and you want generated clients

Recommendation by use case

Situation Pick
Public developer API or partner integration REST + OpenAPI, plus webhooks
Fintech app talking to its own backend REST, or GraphQL if screens combine many sources
E-commerce storefront with rich product pages GraphQL (or a commerce GraphQL API)
Internal microservices gRPC, or REST if traffic is modest
Real-time price or event streams gRPC streaming or websockets
ML inference service gRPC

Summary

Default to REST with a good OpenAPI contract. Add GraphQL where several rich clients need flexible data. Use gRPC for internal high-volume or streaming calls. Whatever you choose, version your contracts, test them, and document them.

We design and build APIs and integrations as part of our product engineering work. Talk to us about your API.

Related services

Related industries

Any idea in mind? Let's make it real.

Tell us what you're building. You'll hear back from an engineer, not a sales team, usually within one working day.

Book a 30-min call