Interview Prep/AWS/Route 53, CloudFront and Messaging

A queue consumer crashes mid-message and the message is processed twice. Is that a bug?

BeginnerScenarioRoute 53, CloudFront and Messaging
Answer

Situation read → SQS standard is at-least-once, so duplicates are expected.

What I'd do →

  1. Make consumers idempotent using a dedupe key in DynamoDB with a conditional write
  2. Tune VisibilityTimeout above processing time
  3. Use FIFO with MessageDeduplicationId if ordering and dedupe are needed
  4. Configure a DLQ
  5. Delete only after success: aws sqs delete-message

Why → Visibility timeout hides the message during processing, crashes make it reappear.

Interview tip → Idempotency is the answer to every at-least-once system.

aws All AWS questions Roadmap: AWS core services

More on Route 53, CloudFront and Messaging