Topic

API Design

4 min read

Health checks for APIs: /healthz, /readyz, /livez, version, and metrics in OpenAPI

Liveness and readiness are different questions: is the process running, and can it serve traffic right now including its dependencies? Collapse them into one /health endpoint and Kubernetes kills a pod briefly waiting on its database, or routes traffic to a half-warmed instance. Here is the...

Read article
4 min read

Prevent lost updates with ETag and If-Match: optimistic concurrency in OpenAPI

Two clients PUT the same resource and the last write silently wins. The HTTP fix is conditional requests with ETag, If-Match, and a 412 that tells the client to re-fetch and retry. Here is the exact state table and the OpenAPI that makes codegen and AI agents handle conflicts correctly.

Read article