Cloud concept · Updated

Asynchronous Communication - Asynchronous communication lets a sender submit work or information without waiting for the receiver to finish processing it.

In short

Applications exchange messages, events, or job requests and obtain results separately through polling, callbacks, or notifications. This decouples components and helps absorb traffic bursts, but requires explicit handling of delivery failures, duplicate processing, and delayed results.

Cloud Concepts Hub →

6 key aspects of Asynchronous Communication

Effective asynchronous communication combines decoupled execution with explicit completion tracking, bounded concurrency, safe retries, and end-to-end latency measurement.

01
Separate acceptance from completion

Return an acknowledgment or job identifier after work is accepted, and expose completion through a status endpoint, callback, or notification. Keep accepted, running, succeeded, and failed states distinct.

02
Decoupled producers and consumers

Producers submit work without requiring consumers to finish immediately. Durable messaging can allow processing to resume after consumer outages, subject to retention limits.

03
Controlled concurrency and backpressure

Bound worker concurrency according to model quotas, token throughput, and retrieval-system capacity. Monitor backlog age and reject or defer new submissions when completion objectives cannot be met.

04
Idempotent processing and bounded retries

Assume duplicate delivery or ambiguous outcomes are possible and make repeated processing safe. Combine durable job-state checks with bounded retries and dead-letter handling.

05
Dependency-aware parallelism

Overlap independent retrieval or inference operations, but preserve dependencies such as retrieving context before generating a grounded answer. Additional concurrency can worsen throttling and tail latency if downstream capacity is fixed.

06
End-to-end observability

Trace each job across submission, transport, retrieval, inference, and result delivery. Measure queue delay and total completion latency separately from API acceptance time.

Cloud services for Asynchronous Communication

An application can enqueue a document-processing job in Amazon SQS, use AWS Lambda for bounded background processing within its execution limits, and invoke Amazon Bedrock for generation. AWS Step Functions can coordinate retrieval, inference, and result persistence when the workflow needs explicit state and recovery. Amazon EventBridge can route completion events to downstream consumers. These services address different responsibilities: buffering, execution, orchestration, inference, and event routing. Configure each integration's delivery and retry behavior, propagate job identifiers throughout the workflow, and measure queue delay alongside retrieval and model latency.

Amazon EventBridgeAmazon EventBridge

Routes events to interested targets, allowing producers to announce changes without directly coordinating every consumer. It suits document-ingestion triggers and job-completion events, while target retry policies and dead-letter queues help handle delivery failures.

AWS LambdaAWS Lambda

Runs background handlers through asynchronous invocation or event source integrations such as SQS. SQS-triggered execution uses a polling integration rather than Lambda's asynchronous invocation queue, so retry and failure behavior must be configured for the actual integration.

AWS Step FunctionsAWS Step Functions

Coordinates multi-stage workflows with explicit state, retries, parallel branches, and error handling. Supported job-run and callback integration patterns let workflows coordinate longer-running work without requiring the original client connection to remain open.

Amazon Bedrock

Workers can invoke foundation models through Amazon Bedrock as part of an asynchronous application workflow. For supported models, its asynchronous inference API accepts jobs whose status can be checked later and writes output to Amazon S3; availability and request formats depend on the model.

Asynchronous Communication exam questions

Real practice exam questions on Asynchronous Communication, with the correct answer and its explanation. Answer them with every option in the exam simulator.

DVA-C02

A checkout application directly invokes an AWS Lambda function through an AWS SDK to calculate a final order total. The application must obtain the calculated total before submitting a payment. If the function's handler throws an exception, the application must stop checkout and report a calculation failure. Which implementation meets these requirements?

Show answerCORRECT ANSWER

Invoke the function with InvocationType set to RequestResponse. Handle SDK request errors, inspect the response's FunctionError field, and use the returned payload as the calculated total only when the function execution succeeded.

RequestResponse invokes the function synchronously and returns its execution result. Request-level failures can produce SDK errors, while an exception from the function's handler is indicated by FunctionError and an error payload. Checking both allows the application to stop on failure and use the calculated total only after successful execution.

AIP-C01

A company uses container workers to process queued insurance-claim analysis jobs with an Amazon Bedrock foundation model. After generating and validating an analysis, each worker sends the result to a customer's webhook. The worker acknowledges the job only after the webhook returns a successful response.

Some customer webhooks remain unavailable for several minutes. During these outages, workers spend most of their time retrying webhook requests, and the backlog of jobs awaiting inference grows. If a worker restarts before acknowledging a job, another worker repeats the model invocation. Each job has a stable identifier, and customers can deduplicate notifications by event identifier.

The company must release inference workers without waiting for customer webhooks, avoid repeating inference for durably completed jobs, and preserve notification delivery attempts across process failures. The result database supports transactions.

Which design best meets these requirements?

Show answerCORRECT ANSWER

Transactionally store the completed result and a pending notification record keyed by job identifier. Acknowledge the inference job after that transaction commits, and skip inference for redelivered jobs with completed results. Use independent dispatchers to retry pending notifications with a stable event identifier and mark them delivered after webhook success.

The transaction durably records both completion and the obligation to notify before the inference job is acknowledged. Independent dispatchers keep slow webhooks from occupying inference workers. A completed-job check prevents reinference after redelivery, while stable event identifiers let customers deduplicate notifications if a dispatcher fails after delivery but before recording success.

Practice Asynchronous Communication in a full exam

Questions on Asynchronous Communication in each practice exam, with every answer option and an explanation for each:

Start a free practice exam

What is Asynchronous Communication

3 min read

Asynchronous communication separates submitting work from completing it. In a synchronous interaction, the caller waits for a response containing the outcome before continuing the dependent operation. In an asynchronous interaction, the caller can receive an acknowledgment or job identifier and continue other work while processing happens independently. An acknowledgment of acceptance is not confirmation that the business operation succeeded.

Cloud applications commonly implement this pattern with queues, event buses, background workers, and job-oriented APIs. For example, a document-summarization API can store an uploaded document, enqueue its storage reference, and return an HTTP 202 Accepted response with a job identifier and status URL. A worker retrieves the document, invokes a foundation model, stores the summary, and updates the job status. The client later retrieves the result or receives a completion notification. Large documents and sensitive prompts generally belong in access-controlled storage rather than directly in messages.

For generative AI workloads, asynchronous communication is useful when model inference, document ingestion, embedding generation, or evaluation takes longer than an interactive request should remain open. A queue absorbs bursts while worker concurrency is limited to respect model request quotas, token quotas, and vector database capacity. This improves resource utilization and reduces failures caused by overloaded downstream systems. It does not make an individual model generate tokens faster, and queueing can increase end-to-end completion time.

Dependency analysis determines where concurrency helps. Independent retrieval queries or independent model evaluations can run concurrently, subject to resource limits. However, a retrieval-augmented generation workflow usually must obtain relevant context before constructing the final grounded prompt. Making those dependent stages asynchronous does not remove that dependency. Optimize vector queries separately through appropriate metadata filters, retrieval counts, index configuration, and connection reuse. For interactive answers, response streaming can improve time to first visible output; streaming is not equivalent to submitting a durable background job.

Profile the complete workflow before changing communication patterns. Propagate correlation identifiers across the submission API, message transport, worker, retrieval calls, and inference calls. Measure acceptance latency, queue age, retrieval latency, model time to first token where applicable, generation duration, and total job completion latency. Compare prompt and completion token counts with inference duration, and examine percentile latencies rather than averages alone. A fast submission endpoint can conceal a growing backlog, so acceptance latency is not a sufficient performance measure.

Reliability requires explicit delivery and processing semantics. Many messaging systems deliver at least once, so workers must tolerate duplicate messages through idempotency keys, conditional writes, or durable job-state checks. Set processing leases or visibility timeouts to accommodate expected work, extend them when supported, and acknowledge messages only after required results are durably recorded. Use bounded retries with exponential backoff and jitter, and isolate repeatedly failing messages in a dead-letter queue. Model calls can incur duplicate charges after ambiguous failures even when result storage is idempotent.

The main trade-offs are operational complexity, eventual consistency, and delayed failure visibility. Define job states, expiration, cancellation behavior, and result retention explicitly. Apply backpressure through bounded concurrency and admission controls rather than allowing an unlimited backlog. A nonblocking SDK call alone does not provide durable delivery, and a queue does not guarantee global ordering or exactly-once business effects. Choose asynchronous communication when deferred completion is acceptable, not simply because it is assumed to be faster.

Learn Asynchronous Communication in lessons

1 short lesson on Asynchronous Communication in 1 certification course.

Open the lessons