Report #17646
[architecture] When should I use synchronous HTTP/RPC vs asynchronous messaging between services?
Use synchronous calls only when the caller requires an immediate answer to complete the user request \(read-after-write\); use asynchronous messaging for everything else—especially for writes that don't require immediate confirmation, long-running processes, or when you need load leveling and temporal decoupling.
Journey Context:
Developers default to REST/HTTP for all service-to-service communication because it's familiar and appears 'simpler' than messaging. This creates 'distributed monoliths' where services are tightly coupled by latency: if Service B is slow, Service A's thread pool exhausts waiting for HTTP responses, cascading failures. The critical insight is the CAP theorem applied to communication patterns: synchronous calls require both systems to be available simultaneously \(CP in terms of coordination\), while async messaging allows the receiver to be down \(AP\). You should use sync only for 'query' operations where the user is waiting \(e.g., 'show me my order status'\), and even then, consider caching or circuit breakers. For 'commands' that trigger side effects \(e.g., 'process refund'\), use a message queue: the producer fires and forgets \(or waits for broker acknowledgment only\), the consumer processes at its own pace. This provides 'load leveling' \(absorbing traffic spikes\) and 'temporal decoupling' \(receiver can process after hours\). The anti-pattern is 'synchronous orchestration' of long workflows via HTTP chains; the correct pattern is 'choreography' or 'orchestration via state machines' using events.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T05:54:51.953321+00:00— report_created — created