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
| Aspect | REST | GraphQL |
|---|---|---|
| Data fetching | Fixed endpoints; over/under-fetching common | Client specifies exact fields needed |
| Transport | HTTP/1.1 + JSON | HTTP POST + JSON (typically) |
| Schema | OpenAPI (optional, external) | Built-in introspection schema |
| Caching | HTTP cache headers work natively | Harder — POST-only; needs persisted queries |
| Best client | Public third-party integrations | Mobile/web apps with varied data needs |
Data fetching
RESTFixed endpoints; over/under-fetching commonGraphQLClient specifies exact fields neededTransport
RESTHTTP/1.1 + JSONGraphQLHTTP POST + JSON (typically)Schema
RESTOpenAPI (optional, external)GraphQLBuilt-in introspection schemaCaching
RESTHTTP cache headers work nativelyGraphQLHarder — POST-only; needs persisted queriesBest client
RESTPublic third-party integrationsGraphQLMobile/web apps with varied data needs
| Aspect | gRPC | When to pick |
|---|---|---|
| Transport | HTTP/2 + Protocol Buffers (binary) | Internal service-to-service calls |
| Performance | Smallest payload, fastest serialization | High-QPS microservice mesh |
| Streaming | Bidirectional streaming built-in | Real-time telemetry, log pipelines |
| Browser support | Needs grpc-web proxy | Not for direct browser clients |
| StreamHub use | Stream service ↔ chat service ↔ notification service | Never exposed to browsers directly |
Transport
gRPCHTTP/2 + Protocol Buffers (binary)When to pickInternal service-to-service callsPerformance
gRPCSmallest payload, fastest serializationWhen to pickHigh-QPS microservice meshStreaming
gRPCBidirectional streaming built-inWhen to pickReal-time telemetry, log pipelinesBrowser support
gRPCNeeds grpc-web proxyWhen to pickNot for direct browser clientsStreamHub use
gRPCStream service ↔ chat service ↔ notification serviceWhen to pickNever exposed to browsers directly
REST — StreamHub public API
API protocol placement
Simple, cacheable, well-understood. Partners integrate with curl and any HTTP library.
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.