Choosing the Right Communication Style
No single protocol fits every interaction. Use synchronous REST or gRPC when the caller needs an immediate answer and the operation is short-lived — "Does this user exist?" or "What is the current stock level?" Use async messaging when the caller can fire-and-forget, when you need to absorb traffic spikes, or when multiple services should react to the same event.
A typical production system combines both: synchronous calls for read-heavy, latency-sensitive paths; events and queues for writes, notifications, and workflows. Add an API Gateway at the edge, service discovery behind it, resilience patterns on every outbound call, and sagas for multi-step business operations. Start simple — direct REST between two services — and add complexity only when measurement proves you need it.
Check your understanding
Sync for which kind of question?Show answerHide answer
Answer
Short reads/commands that need an immediate answer (stock check, user exists).Async for which kind of work?Show answerHide answer
Answer
Side effects, notifications, and multi-step workflows that can proceed without blocking the caller.What should you add on every outbound call?Show answerHide answer
Answer
Timeouts and a resilience policy (retries/circuit breaker) sized to the dependency.