Skip to main content

AI & assistant-friendly summary

This section provides structured content for AI assistants and search engines. You can cite or summarize it when referencing this page.

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 Facts

  • •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

Entity Definitions

Lambda
Lambda is an AWS service discussed in this article.
Aurora
Aurora is an AWS service discussed in this article.
DynamoDB
DynamoDB is an AWS service discussed in this article.
EKS
EKS is an AWS service discussed in this article.
ECS
ECS is an AWS service discussed in this article.
API Gateway
API Gateway is an AWS service discussed in this article.
microservices
microservices is a cloud computing concept discussed in this article.

gRPC, GraphQL, Protobuf, and API Contracts on AWS

Cloud ArchitecturePalaniappan P2 min read

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
Three API contract cards — protobuf, GraphQL, JSON — on a navy desk with an ALB/AppSync split
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 symptomMechanismAWS control
GraphQL N+1 resolver latencySequential data fetches per fieldAppSync pipeline resolvers, batch loaders
Proto breaking changes in prodUnversioned contract evolutionBuf breaking-change CI, ALB gRPC with versioned packages
Large JSON payloadsText serialization overheadgRPC + 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

ProtocolWinsAWS surface
gRPC + protobufStreaming, typed contractsALB → ECS/EKS
GraphQLFlexible readsAppSync
REST + JSONUbiquitousAPI 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

NeedServiceSkip when
Internal typed RPCECS/EKS gRPC behind ALB HTTP/2Public browser clients needing REST
Federated GraphQLAppSyncSimple CRUD with no client-driven queries
Contract governanceProtobuf + Schema Registry on MSKTwo-service integration with shared DTO

What to do this week

  1. Benchmark protobuf vs JSON on hottest endpoint—measure CPU not just bytes.
  2. Trace GraphQL resolver count per query in AppSync logs.
  3. Add breaking-change check in CI for .proto files.

More in This Track

Part of the Engineering Guides library (June 2026).

What this guide doesn’t cover

OAuth—part 1 of API track.

Frequently asked questions

When should I not put GraphQL on the service mesh?
Do not GraphQL east-west microservices. Use gRPC plus protobuf internally, REST/JSON north-south, and GraphQL only when multiple clients need different field shapes. N+1 resolvers will otherwise serialize Aurora.
Does ALB gRPC health checking work like HTTP?
No. ALB gRPC over HTTP/2 needs gRPC-specific health checks. Misconfigured checks fail targets that are serving fine on a REST probe.
How do I evolve protobuf without breaking consumers?
Reserve fields, never reuse numbers, and run Buf breaking-change CI. GraphQL should deprecate before removal. Add Pact consumer contracts in CI for internal services.
Do I still need idempotency keys on gRPC mutations?
Yes for payment and other unsafe writes, regardless of protocol. HTTP Idempotency-Key plus a DynamoDB store still applies when the mutation can retry.
Palaniappan P
Palaniappan P

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.

AWS ArchitectureCloud MigrationGenAI on AWSCost OptimizationDevOps

Recommended Reading

Explore All Articles »