---
title: gRPC, GraphQL, Protobuf, and API Contracts on AWS
description: Protobuf on the wire saves bytes, and GraphQL saves round trips until resolvers N+1 your Aurora cluster. ALB gRPC, AppSync, and consumer-driven contracts with Pact.
url: https://www.joinhorizon.co/blog/grpc-graphql-protobuf-api-contracts-aws/
datePublished: 2026-06-12T00:00:00.000Z
dateModified: 2026-10-28T00:00:00.000Z
author: palaniappan-p
category: Cloud Architecture
tags: engineering-guide, api, grpc, graphql, aws
---

# gRPC, GraphQL, Protobuf, and API Contracts on AWS

> Protobuf on the wire saves bytes, and GraphQL saves round trips until resolvers N+1 your Aurora cluster. ALB gRPC, AppSync, and consumer-driven contracts with Pact.

As of June 2026, ALB supports gRPC over HTTP/2 to targets, and health checks need gRPC-specific config. AppSync hosts GraphQL with resolver mapping to Lambda/DynamoDB.

## Symptoms, mechanisms, and AWS controls

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

My recommendation: gRPC/protobuf east-west, REST/JSON north-south, and GraphQL only when multiple clients need different field shapes. Don't put GraphQL across 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 runs resolvers per field. Batch with DataLoader pattern or AppSync pipeline resolvers.

## Schema evolution

Protobuf: reserve fields, never reuse numbers. GraphQL: deprecate fields before removal. Run Pact consumer contracts in CI for internal microservices.

## Idempotency keys

HTTP `Idempotency-Key` header at API Gateway plus a DynamoDB store is 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

1. Benchmark protobuf vs JSON on your hottest endpoint, and 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).

- Previous: [Part 2](https://www.joinhorizon.co/blog/rate-limiting-token-bucket-leaky-bucket-aws-waf-apigw/)
- Next: [Part 4](https://www.joinhorizon.co/blog/aws-api-gateway-patterns-rest-http-websocket/)
- Browse tracks: [Engineering Guides hub](https://www.joinhorizon.co/resources/engineering-guides/)

## What this guide doesn't cover

OAuth is covered in part 1 of the API track.

## FAQ

### 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.

---

*Source: https://www.joinhorizon.co/blog/grpc-graphql-protobuf-api-contracts-aws/*
