Search⌘ K

Synchronous vs. Asynchronous Communication in Distributed Systems

Understand synchronous and asynchronous communication and learn how to choose the right approach for different workflows in distributed systems.

In a distributed system, the way services communicate is a fundamental architectural decision that impacts scalability, reliability, and complexity.

Choosing the right strategy is a key System Design skill, as a poor choice can lead to cascading failures, while a good one enables a system to scale and evolve efficiently. This lesson explores the two primary communication paradigms: synchronous and asynchronous. We’ll break down their mechanics, analyze their advantages and disadvantages, and examine patterns for effective application.

Let’s begin with the first model: synchronous communication.

Synchronous communication

In synchronous communication, the sender dispatches a request and must wait for a response from the receiver before continuing its own execution.

This waiting period is why it’s known as a blocking communication method. This interaction model is often compared to a phone call, where both parties must be present and engaged in the conversation simultaneously. The client is temporarily coupled to the service it calls, awaiting a direct answer.

The following diagram visualizes this blocking, request-response flow:

Synchronous (blocking) communication
Synchronous (blocking) communication

This diagram illustrates a chained synchronous call.

The client sends a request to service A, which must then call service B to get the information it needs. The final response is only sent back to the client after the entire chain is complete. The key takeaway is that the client is blocked and must wait for all downstream services to finish, which increases latency and the risk of failure.

Educative byte: Synchronous doesn’t always mean fast. It simply means the caller is blocked until the callee completes its work and responds. This blocking time can become a significant performance bottleneck.

This model is primarily implemented using protocols like HTTP/REST and gRPCA modern, open-source, high-performance Remote Procedure Call (RPC) framework that can run in any environment. It uses HTTP/2 for transport and Protocol Buffers as the interface definition language.. Let’s discuss some advantages and disadvantages involved in synchronous communication.

The following are some of the advantages of synchronous communication:

  • Simplicity: The programming model is straightforward. The control flow is linear and easier to reason about, as the client gets an immediate success or failure ...