Synchronous vs Asynchronous Communication
When a service should wait for an answer and when it should hand the work off and move on: what each choice costs in latency, failure and consistency, and the patterns that make the asynchronous path safe.
Overview
A synchronous call means the caller sends a request and waits for the answer before it does anything else. An HTTP or gRPC call that the user's request depends on is synchronous. An asynchronous hand-off means the caller records the work somewhere, usually on a queue or a log, and moves on; another service does the work later and the caller learns the result some other way, or never needs to.
The choice decides three things about a design. How long the user waits, because every synchronous hop adds its time to the response. How failures spread, because a caller that waits on a broken service is also broken. And how data stays correct, because work done later is not done yet when the user gets an answer.
Almost every real system uses both. The skill interviewers look for is splitting one user action into the part that must finish before you answer and the part that can happen after, then making the second part safe: no lost messages, no double charges, and a way to undo steps that fail halfway.
What you will be able to do
- Split a user action into a synchronous path and asynchronous work, and say why each step is where it is.
- Stop one slow dependency from taking down its callers, with timeouts, retry budgets and circuit breakers.
- Return a result for long work with 202 Accepted and polling, or with a webhook.
- Publish an event reliably after a database write with the transactional outbox.
- Run a multi-service business process as a saga, and choose between choreography and orchestration.
Key concepts
- Request and response
- Temporal coupling
- Timeouts and retries
- Circuit breakers
- Fire-and-forget and pub/sub
- 202 Accepted and webhooks
- Queues as buffers
- Transactional outbox
- Sagas
- async/await
Interview questions
- When do you use synchronous calls and when asynchronous messaging?
- Design the checkout of an online store. What is synchronous and what is not?
- How do you stop one slow service from taking down everything that calls it?
- What is the dual-write problem, and how does the outbox solve it?
- What is a saga, and how is it different from a distributed transaction?
- A request starts work that takes two minutes. How does the client get the result?
- What new problems does asynchronous messaging bring, and how do you handle them?
- Is async/await the same thing as asynchronous communication?
Sign up free to read the full topic
More System Design topics
Start free on Cariara · Coding problems · System design studio