DVA-C02 Question 53
Single answerYou are developing a serverless application that processes customer orders in real-time. The application architecture requires that new orders from an e-commerce website trigger an order processing Lambda function. Additionally, the architecture must ensure that order events are durable and replayable in case of failures. Which AWS service is the most suitable to use as the event source for your Lambda function?
- A
Amazon SQS
- B
Amazon SNS
- C
Amazon Kinesis Data Streams
- D
Amazon EventBridge
Show answer and explanation
Correct answer: A
Explanation
Amazon SQS is the best choice for this scenario because it acts as a reliable, durable, and replayable message queue that can trigger AWS Lambda functions. This ensures that order events are not lost and can be reprocessed in case of failures. Other options like SNS, Kinesis Data Streams, and EventBridge either lack durability or are not the most efficient choice for this specific use case.
- A. Correct.
Amazon SQS is the correct answer because it provides durability, message queuing, and the ability to replay messages. It integrates seamlessly with AWS Lambda, making it an ideal choice for triggering the Lambda function and ensuring reliability in event-driven architectures.
- B. Incorrect.
Amazon SNS is a pub/sub messaging service, but it does not provide message durability or replayability. It is better suited for fan-out messaging rather than as a durable event source.
- C. Incorrect.
Amazon Kinesis Data Streams is designed for real-time streaming data but can be overly complex for the described use case. While it does support replayability, it is not as straightforward as SQS for triggering Lambda functions.
- D. Incorrect.
Amazon EventBridge is a serverless event bus service that can trigger Lambda functions, but it is not designed for durable or replayable event processing. It is more suited for distributed event-driven applications.