Skip to content

API design

Request lifecycles, middleware, versioning strategies.

Request lifecycle

From the browser to the handler and back. Each hop adds something (auth, rate limit, logging) that a handler shouldn't re-implement per endpoint.

Middleware chain

Cross-cutting concerns compose as a chain. Order matters — e.g. rate-limiting must come after auth when the limit is per-user.

API versioning (path-based)

Multiple versions coexist; clients pin to one. Old versions fade out after a deprecation window.

GraphQL + resolvers

One endpoint, many data sources. Each resolver pulls from the store most natural for its field.

Edit this pageLast updated: