The Wayback Machine - https://web.archive.org/web/20261101111626/https://www.geeksforgeeks.org/system-design/communication-protocols-in-system-design/

Communication Protocols in System Design

Last Updated : 19 Oct, 2026

Communication patterns define how services exchange requests, responses, messages, or events in a distributed system. Two common approaches are synchronous and asynchronous communication, and each is suitable for different latency, coupling, scalability, and reliability requirements.

  • Synchronous communication: The caller waits for the dependent operation to return a result.
  • Asynchronous communication: The sender continues without waiting for immediate processing by the receiver.

Synchronous Communication

Synchronous communication is a request-response pattern where one service sends a request to another and waits for a response before continuing. It is commonly used when an immediate result is required.

  • HTTP Request-Response: Services communicate through REST APIs or SOAP and wait for responses.
  • Remote Procedure Call (RPC): Uses frameworks such as gRPC to invoke remote operations and receive results.
  • Synchronous Messaging: Uses request-reply messaging through brokers, where the sender waits for a response.

Example: An e-commerce application synchronously checks product availability before confirming an order.

service_a
Sync Communication

Applications of Synchronous Communication

Synchronous communication is commonly used when a system needs an immediate response from another service before proceeding with an operation.

  • Database Operations: Used when applications need to wait for query results or confirmation of a database transaction before continuing.
  • Payment Authorization: Allows applications to receive immediate authorization or rejection responses from payment gateways. Final payment settlement may still occur asynchronously.
  • Authentication Services: Used when applications must verify user credentials or validate access tokens before granting access to protected resources.
  • Search APIs: Suitable for requests where users expect immediate search results before proceeding.
  • Remote Procedure Calls (RPCs): Used in distributed systems and microservices when one service calls another and waits for a response.

Challenges of Synchronous Communication

The challenges of Synchronous Communication are:

  • Increased Latency: The caller must wait for a response, which can increase overall response time when dependent services are slow.
  • Blocking and Resource Usage: Waiting for responses can occupy threads or connections in blocking implementations, reducing resource efficiency under heavy traffic.
  • Service Dependencies: If a dependent service becomes slow or unavailable, it can affect the performance and availability of the calling service.
  • Error Handling: Requires proper handling of timeouts, network failures, retries, and partial failures to prevent cascading failures.
  • Scalability Limitations: Handling many concurrent requests and service dependencies can increase resource consumption and make scaling more challenging.

Asynchronous Communication

Asynchronous communication allows services to exchange messages without waiting for an immediate response, enabling independent processing and improving scalability in distributed systems.

  • Loose Coupling: Services communicate independently without requiring both to be available simultaneously when messages are stored reliably.
  • Improved Scalability: Messages can be queued and processed according to consumer capacity.
  • Non-Blocking Processing: Services can continue other operations without waiting for downstream tasks to finish.

Example: An order service sends a message to a queue after placing an order, and payment and notification services process it later without blocking the user.

service_b
Async Communication

Applications of Asynchronous Communication

Asynchronous communication is commonly used in distributed systems and microservices to handle background tasks and improve application responsiveness.

  • Background Processing: Handles tasks such as email notifications, report generation, and file processing without blocking user requests.
  • Event-Driven Systems: Enables services to react independently to events such as order placement or payment completion.
  • Message Queues: Buffers tasks for reliable processing and retry handling during temporary failures.
  • Real-Time Data Processing: Supports processing of logs, IoT events, and analytics data as they arrive.

Challenges of Asynchronous Communication

Asynchronous communication introduces challenges related to message processing, data consistency, and system monitoring. Key challenges include:

  • Increased Complexity: Requires additional mechanisms for retries, error handling, and message buffering.
  • Eventual Consistency: Services may temporarily operate on outdated data until updates are processed.
  • Debugging and Monitoring: Distributed message flows can be difficult to trace and troubleshoot.
  • Message Ordering: Messages may arrive or be processed out of sequence, requiring ordering mechanisms where necessary.

Factors to consider for choosing right communication protocol

Choosing between synchronous and asynchronous communication depends on response requirements, service dependencies, scalability, reliability, and resource usage.

  • Response Time Requirements: Use synchronous communication when an immediate result is required and asynchronous communication when processing can happen later.
  • Service Coupling: Synchronous communication creates runtime dependencies, while asynchronous communication reduces them through messages or events.
  • Scalability Requirements: Synchronous communication may face latency under heavy load, while asynchronous communication can buffer requests and distribute workloads.
  • Reliability and Fault Tolerance: Synchronous communication relies on timeouts and retries, while asynchronous communication can use durable queues and retries to handle temporary failures.
  • Processing Requirements: Synchronous communication suits operations requiring an immediate response, while asynchronous communication suits background tasks and event processing.
  • Resource Utilization: Blocking synchronous communication may occupy threads while waiting, whereas asynchronous communication can reduce waiting-related overhead but may require additional infrastructure.

Synchronous Vs Asynchronous Communication

FeatureSynchronous CommunicationAsynchronous Communication
InteractionCaller waits for a response before completing the dependent operationSender continues without waiting for immediate processing
DependencyHigher temporal dependency between servicesLower temporal dependency
AvailabilityDownstream service is usually required during the requestConsumer may process the message later
Common TechnologiesHTTP/REST, synchronous RPC/gRPCMessage queues, topics, event streams
ResponseImmediate result or failureResult may be delayed or delivered separately
ScalabilityCan require more concurrent resources under high latencyCan buffer workloads and scale consumers independently
Error HandlingErrors can often be returned directly to the callerFailures may require retries, DLQs, idempotency, or monitoring
Best ForInteractive request-response operationsBackground processing, events, workflows, traffic buffering
Comment

Explore