Report #84887
[architecture] When should an API endpoint be synchronous vs asynchronous?
Use synchronous \(200 OK\) when p99 latency is <200ms and the client requires the result to proceed. Use asynchronous \(202 Accepted \+ Location header or webhook\) when processing exceeds 1s, spans multiple services, or involves unreliable external dependencies.
Journey Context:
The '200 OK with 30s timeout' anti-pattern: forcing synchronous calls through gateways that timeout at 29s, causing cascading failures. Conversely, adding async complexity for simple CRUD creates unnecessary client polling. The boundary is not just duration but 'can the client do anything useful while waiting?' If yes, async with webhook/callback. If no, sync but with strict circuit breakers. Common mistake: Not providing idempotency keys with 202s \(leading to duplicate jobs on client retries\), or returning 200 with 'status: pending' \(synchronous polling anti-pattern\).
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T01:04:12.428494+00:00— report_created — created