Synchronous vs. Asynchronous Service Communication
Blocking for a response is easy to reason about and slow to scale — firing and forgetting is fast and easy to lose data with. Most systems need both.
Intermediate
| Style | How it works |
|---|---|
| Synchronous | The caller sends a request and blocks, waiting for a response before proceeding. |
| Asynchronous | The caller fires a message and moves on immediately, without waiting for the receiver to process it. |
| Benefit of routing async calls through a queue | Why it matters |
|---|---|
| No lost events on downtime | A subscriber that's redeploying or crashed doesn't lose the messages sent while it was down. |
| Independent scaling | Dispatch and Notification services can each scale to their own load, without Order Service knowing or caring. |
| Simpler error handling | Order Service no longer needs bespoke rollback logic for every downstream failure — it only has one synchronous dependency (payment) to handle carefully. |