
Answer-first summary for fast verification
Answer: Create an Amazon API Gateway HTTP API that implements the RESTful API. Create an Amazon Simple Queue Service (Amazon SQS) queue. Create an API Gateway service integration with the SQS queue. Create an AWS Lambda function to process messages in the SQS queue.
Answer B is the correct solution because it effectively addresses all the given requirements: 1. **API Gateway and SQS Integration**: Amazon API Gateway can handle the unpredictable bursts of traffic by scaling automatically to meet the request demand. By implementing the RESTful API on API Gateway and integrating it with an Amazon SQS queue, the incoming data is reliably queued without any data loss. SQS provides a durable and scalable buffer layer to decouple the data ingestion from the processing logic. 2. **Processing with AWS Lambda**: AWS Lambda functions are well-suited to process messages from the SQS queue. Lambda can scale automatically based on the amount of traffic, ensuring that even during high-volume periods, messages are processed efficiently and without provisioning infrastructure manually. Other options do not fit as well for the following reasons: - **Option A** suggests using an ALB with an SQS queue, but SQS cannot be directly targeted by an ALB. - **Option C** involves managing EC2 instances, which can introduce operational overhead and might not scale as efficiently as Lambda functions in handling bursts of traffic. - **Option D** suggests using CloudFront with Kinesis Data Streams, which is not an appropriate setup for handling RESTful API traffic and involves more complexity than necessary. Hence, option B provides a robust, scalable, and serverless approach to meet the requirements without incurring data loss.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
No comments yet.
A company runs a processing engine in the AWS Cloud. The engine processes environmental data from logistics centers to calculate a sustainability index. The company has millions of devices in logistics centers that are spread across Europe. The devices send information to the processing engine through a RESTful API. The API experiences unpredictable bursts of traffic. The company must implement a solution to process all data that the devices send to the processing engine. Data loss is unacceptable. Which solution will meet these requirements?
A
Create an Application Load Balancer (ALB) for the RESTful API. Create an Amazon Simple Queue Service (Amazon SQS) queue. Create a listener and a target group for the ALB Add the SQS queue as the target. Use a container that runs in Amazon Elastic Container Service (Amazon ECS) with the Fargate launch type to process messages in the queue.
B
Create an Amazon API Gateway HTTP API that implements the RESTful API. Create an Amazon Simple Queue Service (Amazon SQS) queue. Create an API Gateway service integration with the SQS queue. Create an AWS Lambda function to process messages in the SQS queue.
C
Create an Amazon API Gateway REST API that implements the RESTful API. Create a fleet of Amazon EC2 instances in an Auto Scaling group. Create an API Gateway Auto Scaling group proxy integration. Use the EC2 instances to process incoming data.
D
Create an Amazon CloudFront distribution for the RESTful API. Create a data stream in Amazon Kinesis Data Streams. Set the data stream as the origin for the distribution. Create an AWS Lambda function to consume and process data in the data stream.