
Answer-first summary for fast verification
Answer: Create an Amazon Simple Queue Service (Amazon SQS) queue, and subscribe it to the SNS topic., Modify the Lambda function to read from an Amazon Simple Queue Service (Amazon SQS) queue.
## Explanation This question addresses **resiliency** in a data ingestion workflow that's experiencing failures due to network connectivity issues. The current architecture uses SNS → Lambda directly, which has a limitation: if the Lambda function fails to process a message (due to network issues), the message is lost unless manually retried. ### Why Options B and E are Correct: 1. **Option B: Create an Amazon SQS queue and subscribe it to the SNS topic** - This creates a **durable message buffer** between SNS and Lambda - Messages are stored in SQS even if Lambda is unavailable - SQS provides **message retention** (up to 14 days) and **automatic retries** - This decouples the producer (SNS) from the consumer (Lambda) 2. **Option E: Modify the Lambda function to read from an Amazon SQS queue** - This completes the architectural pattern: SNS → SQS → Lambda - Lambda can be configured as an SQS event source with built-in retry logic - Failed messages remain in the queue for reprocessing - Lambda can process messages with configurable batch sizes and retry attempts ### Why Other Options are Incorrect: - **Option A: Deploy the Lambda function in multiple Availability Zones** - Lambda functions are already highly available across multiple AZs by AWS's design - This doesn't address the message loss issue when Lambda fails to process - **Option C: Increase the CPU and memory that are allocated to the Lambda function** - This addresses performance issues, not resiliency to network failures - More resources won't prevent message loss when Lambda invocation fails - **Option D: Increase provisioned throughput for the Lambda function** - This refers to provisioned concurrency, which helps with cold starts - Doesn't solve the problem of message durability during failures ### Key Architecture Pattern: The solution implements the **SNS fanout pattern with SQS queue** for reliable message delivery: 1. SNS publishes messages to multiple subscribers (including SQS) 2. SQS acts as a durable buffer 3. Lambda processes messages from SQS with built-in retry capabilities 4. Failed messages remain in the queue's dead-letter queue (DLQ) for investigation This pattern ensures **at-least-once delivery** and **fault tolerance** for the data ingestion workflow.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
No comments yet.
A company has a data ingestion workflow that consists of the following:
The company observes that the ingestion workflow fails occasionally because of network connectivity issues. When such a failure occurs, the Lambda function does not ingest the corresponding data unless the company manually reruns the job.
Which combination of actions should a solutions architect take to ensure that the Lambda function ingests all data in the future? (Choose two.)
A
Deploy the Lambda function in multiple Availability Zones.
B
Create an Amazon Simple Queue Service (Amazon SQS) queue, and subscribe it to the SNS topic.
C
Increase the CPU and memory that are allocated to the Lambda function.
D
Increase provisioned throughput for the Lambda function.
E
Modify the Lambda function to read from an Amazon Simple Queue Service (Amazon SQS) queue.