Skip to content

API design: contracts that survive retries

Choose an API shape, a live-update transport and a pagination contract; evolve clients safely and make retries safe.

20 min7 steps

By the end you can
  • Choose REST, gRPC or GraphQL for a concrete client contract
  • Choose WebSockets, SSE or long polling for live updates
  • Explain offset drift and cursor pagination requirements
  • Preserve compatibility while evolving an API
  • Scope and persist idempotency keys to make retries safe

Choose the contract shape

REST

  • Resource identifiers
  • HTTP method semantics

gRPC

  • Typed service methods
  • Generated clients; streaming

GraphQL

  • Typed graph schema
  • Client selects response fields

REST is an architectural style, not just JSON over HTTP. gRPC exposes typed procedures. GraphQL lets clients select graph fields; the server still owns authorization, query cost and data access.

A controlled fleet needs generated, strongly typed service clients and bidirectional RPC streams. Which is the closest fit?

Answer this step to continue.