How it works · 13 of 49 Core
Synchronous vs asynchronous communication between services: what is the difference?
Who waits for whom
Sync vs async: A synchronous call makes the caller wait on the line until the answer comes back, so in a chain of calls the customer waits for every step added together, and every caller is held while the slowest one works. An asynchronous message is left for the next service to pick up; the sender answers at once and gets back to work. The price: "received" is not "done", so you need a way to tell the customer later, an id on every message, and handling for messages that arrive twice.
Loading the animation…
Say it like this A synchronous call makes everyone up the chain wait for the slowest step; an asynchronous message lets each service answer at once and get on, at the price of telling the customer later and handling duplicates.
Under the hood — for builders
- The source, in its words
- Microsoft's Azure Architecture Center: synchronous is when "the caller waits for a response from the receiver"; asynchronous, a service "sends message without waiting for a response." And: "If there's a chain of service dependencies (for example, service A calls B, which calls C), waiting on synchronous calls can add unacceptable amounts of latency."
- Run here: the chain on the card
- Shop, Payment, Stock and Courier as four tiny HTTP services, 20 ms of work each, Courier 3 s. Sync: each calls the next and waits. Async: each puts a note on the next one's queue and answers at once:
- What async buys, and what it costs
- Microsoft's lists, in short:
- The name on the cup
- Gregor Hohpe (2004): Starbucks takes orders asynchronously to maximise throughput, and writes your name on the cup, a correlation id, because drinks finish out of order. Idempotent: running the same message twice changes nothing more.
- Async I/O is not async messaging
- Microsoft: "HTTP is a synchronous protocol, even though an HTTP client might use asynchronous I/O." Non-blocking code still makes the customer wait for the answer.
- Measure it
- Customer-facing latency per step · callers held per request · queue depth and age of the oldest message · duplicate rate · time from received to done.
- Watch out
- A queue hides a dead reader: alert on message age, not just errors. Don't send work async when the customer needs the answer now (is the card valid?).
- Sources
- Microsoft, "Interservice communication in microservices", Azure Architecture Center · Hohpe, "Starbucks Does Not Use Two-Phase Commit", enterpriseintegrationpatterns.com, 2004 · both read in session · toy chain, Python, run 19 Nov 2026.
What happens in the sync vs async animation, step by step?
- One order, four services. Top: each one calls the next and waits on the line. Bottom: each leaves a note in the next one's in-tray.
- Your turn: Courier takes 3 seconds today. How long does the customer in the top lane wait?
- On the phone, every caller holds the line until the one after answers: three services held, and the customer waits 3.07 s.
- With notes, Shop answers in 0.02 s and gets back to work. Courier's slowness only delays the note in its own tray.
- Courier goes down. Calls fail all the way back to the customer; notes wait in the tray until it's back.
- The price: received is not done. You need a later update, an id on every note, and a way to ignore duplicates. Next: who runs a many-step flow.
What everyday example explains sync vs async?
A phone call vs leaving a note. On a call you both hold the line until it's sorted; a note in someone's in-tray lets you get on with your day.
Why should a team care about sync vs async?
Every synchronous hop adds its wait to the customer's and holds a thread, a connection and memory at every caller in the chain. Use a call when the answer is needed now (is the card valid?); leave a note when the work can finish later (ship, email, invoice).