gRPC, GraphQL, Protobuf, and API Contracts on AWS
Quick summary: Protobuf on the wire saves bytes; GraphQL saves round trips until resolvers N+1 your Aurora cluster. ALB gRPC, AppSync, and consumer-driven contracts with Pact.
Key Takeaways
- Protobuf on the wire saves bytes; GraphQL saves round trips until resolvers N+1 your Aurora cluster
- ALB (June 2026) supports gRPC over HTTP/2 to targets—health checks need gRPC-specific config
- AppSync hosts GraphQL with resolver mapping to Lambda/DynamoDB
- Benchmark pattern (hypothetical workload) — gRPC/protobuf internal API on ECS, 15K RPS, payload 180 bytes avg, p99 6ms; GraphQL AppSync resolver chain same data: 2
- 1K RPS, p99 89ms; REST JSON ALB: 4
Table of Contents
ALB (June 2026) supports gRPC over HTTP/2 to targets—health checks need gRPC-specific config. AppSync hosts GraphQL with resolver mapping to Lambda/DynamoDB.
Symptom → mechanism → AWS control
| Production symptom | Mechanism | AWS control |
|---|---|---|
| GraphQL N+1 resolver latency | Sequential data fetches per field | AppSync pipeline resolvers, batch loaders |
| Proto breaking changes in prod | Unversioned contract evolution | Buf breaking-change CI, ALB gRPC with versioned packages |
| Large JSON payloads | Text serialization overhead | gRPC + protobuf on NLB/ALB HTTP/2, API Gateway REST for external |
Opinionated take: gRPC/protobuf east-west, REST/JSON north-south, GraphQL only when multiple clients need different field shapes—don’t GraphQL your microservices mesh.
Benchmark pattern (hypothetical workload) — gRPC/protobuf internal API on ECS, 15K RPS, payload 180 bytes avg, p99 6ms; GraphQL AppSync resolver chain same data: 2.1K RPS, p99 89ms; REST JSON ALB: 4.5K RPS, p99 22ms.
Protocol choice
| Protocol | Wins | AWS surface |
|---|---|---|
| gRPC + protobuf | Streaming, typed contracts | ALB → ECS/EKS |
| GraphQL | Flexible reads | AppSync |
| REST + JSON | Ubiquitous | API Gateway HTTP API |
N+1 problem: GraphQL resolvers per field—batch with DataLoader pattern or AppSync pipeline resolvers.
Schema evolution
Protobuf: reserve fields, never reuse numbers. GraphQL: deprecate fields before removal. Pact consumer contracts in CI for internal microservices.
Idempotency keys
HTTP Idempotency-Key header at API Gateway + DynamoDB store—required for payment mutations regardless of protocol.
AWS services map
| Need | Service | Skip when |
|---|---|---|
| Internal typed RPC | ECS/EKS gRPC behind ALB HTTP/2 | Public browser clients needing REST |
| Federated GraphQL | AppSync | Simple CRUD with no client-driven queries |
| Contract governance | Protobuf + Schema Registry on MSK | Two-service integration with shared DTO |
What to do this week
- Benchmark protobuf vs JSON on hottest endpoint—measure CPU not just bytes.
- Trace GraphQL resolver count per query in AppSync logs.
- Add breaking-change check in CI for
.protofiles.
More in This Track
Part of the Engineering Guides library (June 2026).
- Previous: Part 2
- Next: Part 4
- Browse tracks: Engineering Guides hub
What this guide doesn’t cover
OAuth—part 1 of API track.
AWS Cloud Architect & AI Expert
AWS-certified cloud architect and AI expert with deep expertise in cloud migrations, cost optimization, and generative AI on AWS.