techdiagrams.net
← All templates

API platform — composition, idempotency & webhooks

The two API composition styles (gateway aggregation vs GraphQL federation) side by side, with DataLoader batching against N+1, idempotency keys on writes, and signed webhooks with retry.

Open in editor — free, no login Download JSON
GraphQL — one queryREST · Idempotency-Keybatched resolversone query for N idsaggregatededupe writesdomain eventssigned webhookAPI Consumerspartners + appsREST Gatewayaggregation · rate limitsGraphQL Federationone graph, many subgraphsDataLoader Layerbatch + dedupe per requestOrders APIsubgraph + RESTUsers APIsubgraph + RESTIdempotency Storekey → response, TTL 24hWebhook Dispatchersigned · retried · dead-letteredPartner Endpointtheir infrastructure, their bugspick ONE composition style per clientclass — running both for the sameclients doubles every schema changewebhook contract:HMAC signature + timestamp window(replay protection), retries withbackoff, DLQ + manual replay

What this design does

A public API is four disciplines wearing one trench coat: composition (gateway aggregation or a federated graph), write safety (idempotency keys), read efficiency (DataLoader batching so one query doesn't become a hundred), and outbound delivery (webhooks that are signed, replay-protected and retried). This template puts all four on one canvas so the trade-offs stay visible.

The patterns it composes

Import it, attach your own numbers, and verify the design against failures — or read the engineering notes.