Amazon SQS can deliver a meter-reading message more than once, and blindly inserting each delivery would double-bill residents. How should the consumer be designed?
Select an answer to reveal the explanation.
Short Explanation
Treat each meter reading like a check that shouldn't clear twice—stamp a dedupe key or conditional write so a second delivery is a no-op. SQS is at-least-once; you can't wish that into exactly-once by turning off retries or stretching visibility forever.
Full Explanation
SQS provides at-least-once delivery, so consumers must be idempotent—typically via business dedupe keys, conditional DynamoDB puts, or equivalent—to avoid duplicate side effects such as double billing. Disabling retries, assuming exactly-once on a standard queue, or relying solely on a long visibility timeout does not eliminate redelivery or duplicate processing risk.