SAP-C02 Question 284
Select 2A company has a serverless application that processes images uploaded to an Amazon S3 bucket. The workflow involves notifying a processing service when new images are uploaded and ensuring that the images are processed only once, even if duplicate upload events occur. The solution must be cost-effective and decoupled. Which combination of AWS services should the company use to implement this workflow?
- A
Amazon S3 event notifications to trigger an Amazon SNS topic, which notifies an Amazon SQS queue
- B
Amazon SQS with a FIFO queue to handle duplicate events and ensure exactly-once processing
- C
AWS Step Functions to coordinate the workflow and handle duplicate events
- D
Amazon EventBridge to detect S3 events and send them to an Amazon SNS topic
- E
Amazon SQS standard queue to handle high throughput and manage duplicate events
Show answer and explanation
Correct answers: A, B
Explanation
The most suitable solution for this scenario involves using Amazon S3 event notifications to trigger an Amazon SNS topic, which then notifies an Amazon SQS FIFO queue. The SQS FIFO queue ensures exactly-once message processing and deduplication, fulfilling the application's requirements for reliable and cost-effective processing of image upload events. Other options either lack deduplication capabilities or are not cost-effective for this use case.
- A. Correct.
This option correctly uses Amazon S3 event notifications to trigger an Amazon SNS topic, which fans out messages to an Amazon SQS queue. This design enables decoupling and ensures reliable message delivery.
- B. Correct.
Amazon SQS FIFO queues are designed for exactly-once processing and deduplication, making them suitable for handling duplicate S3 events in this scenario.
- C. Incorrect.
AWS Step Functions is useful for orchestrating workflows, but it does not inherently handle deduplication of events, which is necessary in this scenario.
- D. Incorrect.
Amazon EventBridge can detect S3 events, but it does not have built-in deduplication capabilities. It is not the most cost-effective solution for this use case.
- E. Incorrect.
Amazon SQS standard queues cannot guarantee exactly-once processing and do not handle deduplication, making them unsuitable for this requirement.