A company has a data ingestion workflow that consists of the following:
• An Amazon Simple Notification Service (Amazon SNS) topic for notifications about new data deliveries
• An AWS Lambda function to process the data and record metadata
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.
BE
技巧:排除明显错误选项,在没有明显错误的选项中选择最合理的选项。
某公司的数据接收工作流程包括以下内容:
•亚马逊简单通知服务(Amazon SNS)主题,用于通知新数据交付
•AWS Lambda 函数,用于处理数据和记录元数据
该公司观察到,由于网络连接问题,摄入工作流程偶尔会失败。当发生此类故障时,Lambda 函数不会摄取相应的数据,除非公司手动重新运行作业。解决方案架构师应该采取哪些行动组合来确保 Lambda 函数在未来接收所有数据?(选择两个。)
A. 不正确。在多个可用区中部署 Lambda 函数。Lambda 函数本身是按需运行的,并不直接部署在特定的可用区中。Lambda 的执行环境是由 AWS 自动管理的。此外,网络连接问题通常不是通过增加可用区数量来解决的。
B. 正确。创建一个 Amazon SQS 队列,并将其订阅到 SNS 主题。通过将 SQS 队列订阅到 SNS 主题,所有通过 SNS 发送的通知(包括新数据交付的通知)都会被发送到 SQS 队列中。这提供了一个缓冲机制,即使 Lambda 函数由于网络问题暂时无法处理消息,消息也会保留在队列中,直到 Lambda 函数恢复并能够处理它们。这是一个有效的解决方案,可以确保消息不会丢失,并在 Lambda 函数恢复后得到处理。
C. 不正确。增加分配给 Lambda 函数的 CPU 和内存。增加 CPU 和内存可能会提高 Lambda 函数的性能,但它并不能解决由于网络连接问题导致的失败。网络连接问题与 Lambda 函数的资源分配无关。
D. 不正确。增加 Lambda 函数的预置吞吐量。Lambda 函数是按需运行的,并且不直接支持“预置吞吐量”的概念。Lambda 的并发执行限制可以通过请求增加,但这与网络连接问题导致的失败无关。
E. 正确。修改 Lambda 函数以从 Amazon SQS 队列中读取。通过修改 Lambda 函数以从 SQS 队列中读取消息,可以确保 Lambda 函数在恢复后能够处理之前由于网络问题而未能处理的消息。这种架构模式(使用 SNS-to-SQS-to-Lambda)是处理间歇性失败和确保消息可靠传递的常见做法。这是一个有效的解决方案,与选项 B 结合使用,可以构建一个健壮的数据摄取工作流程。