DVA-C02 Question 395
Single answerYou are designing a serverless application where users upload images, and each upload triggers a processing workflow. The workflow involves resizing the image, applying filters, and storing the processed image in an S3 bucket. You want to ensure the tasks are decoupled, and processing errors can be retried without losing messages. Which AWS service or combination of services should you use to implement the messaging layer between the image upload process and the processing workflow?
- A
Amazon Simple Queue Service (SQS) with a Dead Letter Queue (DLQ)
- B
Amazon Simple Notification Service (SNS) with multiple subscribers
- C
Amazon SQS FIFO Queue
- D
Amazon EventBridge
Show answer and explanation
Correct answer: A
Explanation
Amazon SQS with a Dead Letter Queue (DLQ) is the best solution for this use case as it ensures reliable communication between the image upload process and the processing workflow. It decouples the components, provides message durability, and supports retries for failed message processing. The DLQ ensures that unprocessed messages are not lost and can be analyzed or reprocessed later. Other options like SNS and EventBridge are not ideal for scenarios requiring message durability and retries.
- A. Correct.
Correct. Amazon SQS with a Dead Letter Queue (DLQ) is ideal for decoupling tasks, ensuring messages are not lost, and supporting retries for failed processing. The DLQ allows unprocessed messages to be stored for further inspection.
- B. Incorrect.
Incorrect. While Amazon SNS is good for fan-out patterns with multiple subscribers, it does not guarantee message retention or retries, making it less suitable for this use case.
- C. Incorrect.
Incorrect. Amazon SQS FIFO Queue is used when message order needs to be preserved, which is not a requirement in this scenario. The standard SQS queue is sufficient for this decoupled workflow.
- D. Incorrect.
Incorrect. Amazon EventBridge is a good choice for event-driven architectures, but it is not designed for decoupling tasks with retry mechanisms like Amazon SQS.