Skip to main content
PreparationZone Logo
PrepZone

GraphQL vs REST vs gRPC

Three API styles, three trade-off profiles — pick the right one for your clients and latency budget.

Pass checkpoint below

StreamHub's mobile app uses GraphQL to fetch stream metadata, chat preview, and follower count in one round trip. Internal microservices talk gRPC. Third-party partners consume REST. One platform, three API styles — each chosen for its audience.

Side-by-side comparison

AspectRESTGraphQL
Data fetchingFixed endpoints; over/under-fetching commonClient specifies exact fields needed
TransportHTTP/1.1 + JSONHTTP POST + JSON (typically)
SchemaOpenAPI (optional, external)Built-in introspection schema
CachingHTTP cache headers work nativelyHarder — POST-only; needs persisted queries
Best clientPublic third-party integrationsMobile/web apps with varied data needs
  • Data fetching

    RESTFixed endpoints; over/under-fetching common
    GraphQLClient specifies exact fields needed
  • Transport

    RESTHTTP/1.1 + JSON
    GraphQLHTTP POST + JSON (typically)
  • Schema

    RESTOpenAPI (optional, external)
    GraphQLBuilt-in introspection schema
  • Caching

    RESTHTTP cache headers work natively
    GraphQLHarder — POST-only; needs persisted queries
  • Best client

    RESTPublic third-party integrations
    GraphQLMobile/web apps with varied data needs
AspectgRPCWhen to pick
TransportHTTP/2 + Protocol Buffers (binary)Internal service-to-service calls
PerformanceSmallest payload, fastest serializationHigh-QPS microservice mesh
StreamingBidirectional streaming built-inReal-time telemetry, log pipelines
Browser supportNeeds grpc-web proxyNot for direct browser clients
StreamHub useStream service ↔ chat service ↔ notification serviceNever exposed to browsers directly
  • Transport

    gRPCHTTP/2 + Protocol Buffers (binary)
    When to pickInternal service-to-service calls
  • Performance

    gRPCSmallest payload, fastest serialization
    When to pickHigh-QPS microservice mesh
  • Streaming

    gRPCBidirectional streaming built-in
    When to pickReal-time telemetry, log pipelines
  • Browser support

    gRPCNeeds grpc-web proxy
    When to pickNot for direct browser clients
  • StreamHub use

    gRPCStream service ↔ chat service ↔ notification service
    When to pickNever exposed to browsers directly

REST — StreamHub public API

API protocol placement

NETWORKREST / GraphQLAPI Gateway · public
COMPUTEgRPC internalEKS · mTLS
NETWORKWebSocketALB sticky · chat
REST/GraphQL at edge via API Gateway; gRPC service-to-service inside VPC.

Simple, cacheable, well-understood. Partners integrate with curl and any HTTP library.

Java
GET /v1/streams/live_9912 HTTP/1.1
Accept: application/json
Authorization: Bearer eyJ...

Strengths: HTTP caching, CDN-friendly GETs, massive tooling ecosystem. Weakness: mobile home screen needs 4–5 REST calls for one view.

The rest of this guide is part of Pro

Free covers every fresher guide in full. Pro unlocks Senior, Staff and Architect guides across every track.

Still to come · 3 sections

  • GraphQL — StreamHub mobile BFF
  • gRPC — internal mesh
  • Decision framework

Test yourself

Answer these before moving on — recall is what makes it stick.