1.Synchronous request/response vs asynchronous messaging
Synchronous request/response means the caller waits for the callee to finish and reply before continuing — simple, but the caller is blocked for as long as the work takes, and a slow or down dependency directly slows or breaks the caller. Asynchronous messaging means the caller hands off a message and continues immediately, with the work happening independently — the caller is decoupled from how long the work takes, at the cost of not having an immediate result.
Key features
- Synchronous: caller blocks until the response arrives — simple mental model, direct coupling to the callee's latency and availability
- Asynchronous: caller sends a message and continues without waiting for the work to finish — decouples the caller's response time from the work's duration
- Synchronous is the natural fit when the caller genuinely needs a result before it can proceed (a login check, a price lookup for checkout)
- Asynchronous is the natural fit for work that doesn't need to complete before the caller's request finishes (sending an email, generating a report, updating a search index)
- Choosing synchronous when the work is slow or unreliable directly transfers that slowness/unreliability to every caller
Synchronous vs asynchronous, at a glance
- Synchronous
- Server waits for the email provider to confirm
- A slow or down provider slows or breaks every signup
- Caller is blocked for the full duration
- Asynchronous
- Server publishes to a queue and returns immediately
- A worker sends the email independently, whenever it can
- Signup succeeds regardless of the email provider's speed
Command
sync: client -> service -> [wait] -> response -> client
async: client -> queue -> [continue immediately]
↓
worker -> processes laterSynchronous: caller waits, simple, but directly coupled to the callee's speed and availability. Asynchronous: caller continues immediately, decoupled, but has no immediate result — use it for work the caller does not need a result from before proceeding.