CLOUD CONCEPT

Synchronous Communication

Synchronous communication is an interaction in which a caller waits for a receiver’s response before proceeding with work that depends on that response.

Cloud Concepts Hub →

What is Synchronous Communication

Synchronous communication connects a request and its result within the same logical interaction, making it useful when an application needs an immediate answer. It simplifies request-response workflows but couples the caller’s latency and ability to complete dependent work to downstream services.

Synchronous communication means a caller sends a request and waits for a response before continuing work that requires the result. For example, a checkout application might call a pricing service and wait for the calculated total before displaying the payment screen. The response can contain a successful result or an error; synchronous does not mean successful, instantaneous, or guaranteed to finish.

In cloud applications, this pattern commonly appears in HTTP APIs, remote procedure calls, database queries, and direct function invocations. An API endpoint might invoke application code, query a database, and return the retrieved record to its client. Each dependency contributes to the total response time. Sequential calls accumulate latency, while parallel independent calls can reduce elapsed time but still require the caller to wait for the results it needs.

The main benefit is straightforward control flow. The caller can use the returned value immediately and handle a reported failure in the same operation. This suits interactive tasks such as retrieving an account balance, validating input, or calculating a shipping quote. However, synchronous communication alone does not provide transactional guarantees across services. A successful response means only what the API contract promises, not necessarily that every related business activity has completed.

The central trade-off is temporal coupling: the receiver must be available and responsive during the caller’s request window for that interaction to succeed. Slow downstream services can consume connection pools, concurrency capacity, memory, or worker threads and cause failures to spread upstream. Even with nonblocking networking, in-flight requests still require capacity. Use explicit deadlines, bounded concurrency, connection limits, and circuit breakers to prevent a struggling dependency from exhausting the caller.

Timeouts require particular care because they describe what the caller observed, not necessarily what the receiver did. If a payment request times out, the payment might already have been processed. Retrying without an idempotency key can create duplicate charges. Retry only suitable failures, bound retry attempts by the overall deadline, and use exponential backoff with jitter. Where supported, propagate deadlines so downstream work does not continue unnecessarily after its result is no longer useful.

Asynchronous communication separates submission from eventual processing. A caller can submit work to a queue, receive an acknowledgment, and continue without waiting for the business result. This can absorb bursts and let producers and consumers scale independently, but it introduces delayed results, processing-status tracking, and duplicate-handling concerns. A queue submission can itself be a synchronous API call while the business workflow remains asynchronous. Likewise, an HTTP response indicating that a job was accepted does not mean that job has completed.

Do not confuse application-level synchrony with programming-language syntax. An asynchronous SDK method or an await expression can avoid blocking a thread while still implementing a synchronous request-response dependency. For AWS exam questions, distinguish a Lambda RequestResponse invocation, which waits for execution to finish, from an Event invocation, which queues the event for asynchronous execution. Choose synchronous interaction when an immediate result is required; choose asynchronous processing when acceptance now and completion later satisfy the requirement.

Key aspects of Synchronous Communication

Synchronous communication provides direct results but requires deliberate management of dependency latency, uncertain failures, retries, and in-flight capacity.

Response-dependent progress

The caller waits for an answer before completing dependent work. Define whether that answer represents a completed operation, a validation result, or merely acceptance of a request.

Temporal and latency coupling

A downstream service must respond within the caller’s available time budget. Limit dependency chains and measure downstream latency, especially high-percentile response times.

Explicit deadlines and failure handling

Set connection and request timeouts that fit the end-to-end deadline. Treat a timeout as an uncertain outcome rather than proof that the remote operation did not execute.

Safe, bounded retries

Retry transient failures only when the operation can safely be repeated, using idempotency keys where appropriate. Apply backoff, jitter, and retry limits to avoid amplifying an outage.

Capacity protection

Waiting requests consume resources even when networking is nonblocking. Use concurrency limits, bounded connection pools, load shedding, and circuit breakers to contain downstream slowdowns.

Separation from execution syntax

An async function or nonblocking HTTP client does not automatically make the business interaction asynchronous. Classify the interaction by whether the caller needs the processing result before proceeding, not by the SDK method name.

Cloud services for Synchronous Communication

Amazon API Gateway can expose an endpoint that synchronously invokes AWS Lambda and returns the function’s result. For container or instance backends, an Application Load Balancer can route requests to application targets and relay their responses. When a short multi-step operation must return a final result, an application can invoke a Step Functions Synchronous Express Workflow. Across these designs, align client deadlines with intermediary and backend limits, inspect application-level outcomes, and protect downstream capacity. For longer work, return an acceptance response and track completion separately rather than holding the original request open.

Amazon API Gateway image Amazon API Gateway

API Gateway commonly exposes request-response APIs that wait for an integration response before replying to the client. Integration timeouts and backend latency constrain the interaction; an API that only accepts background work does not make that work synchronous.

Open Amazon API Gateway →
AWS Lambda image AWS Lambda

Invoking Lambda with InvocationType set to RequestResponse waits for function execution and returns its response. Inspect function-error information as well as the invocation status; Event invocation instead queues the event for asynchronous execution.

Open AWS Lambda →
AWS Step Functions image AWS Step Functions

Synchronous Express Workflows support StartSyncExecution, which waits for the workflow to finish and returns its outcome. Standard Workflows do not support this API, so distinguish the workflow type and invocation method when selecting a synchronous interface.

Open AWS Step Functions →