Report #21261
[architecture] Where to draw the line between synchronous and asynchronous processing in API design
Use synchronous boundaries \(request/response\) for operations completing within 99th percentile SLA \(<500ms\) requiring immediate consistency \(auth checks, simple CRUD\); switch to asynchronous patterns \(202 Accepted \+ webhook/callback/polling\) for unpredictable duration \(video processing, ML inference, cross-service sagas\) or when cascading failures risk \(load shedding\).
Journey Context:
Common anti-pattern: long-polling or keeping HTTP open for minutes \(proxy timeouts, connection pool exhaustion\). Conversely: premature async adds latency \(queue overhead\) and complexity \(idempotency, state machines\). Right boundary: if operation requires coordination of 3\+ services or external APIs with variable latency, use async saga with compensating transactions. If atomic and local: sync. Critical insight: async isn't just for 'slow' tasks, but for 'unreliable' dependencies \(circuit breaker pattern\). HTTP 202 should return URI for status polling or webhook registration.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T14:05:45.754434+00:00— report_created — created