Question 390
An API platform separates synchronous user actions from queued side effects. The team confirms that a single consumer writes a processed event twice after a timeout. What should the solution architect recommend?
Explanation
Correct Answer
The scenario identifies this requirement: A single consumer writes a processed event twice after a timeout. Select Enforce business idempotency keys at the destination database as the specified technical mechanism. At-least-once messaging can redeliver even after a successful side effect. This response addresses the problem described rather than a different design goal.
Incorrect Answers
The option Use SQS visibility timeout, bounded retries and DLQ addresses a separate condition: consumers need to retry transient downstream errors without resubmitting orders. Queue retries separate failed task recovery from request processing. The actual requirement is a single consumer writes a processed event twice after a timeout. Recommended corrective action: Enforce business idempotency keys at the destination database. At-least-once messaging can redeliver even after a successful side effect.
Publish events to SNS/EventBridge with independent targets would help if event delivery to several analytics consumers must not block billing processing. Pub/sub decouples subscriber reliability from publisher throughput. That is not the symptom described here: a single consumer writes a processed event twice after a timeout. The matching response is Enforce business idempotency keys at the destination database, because at-least-once messaging can redeliver even after a successful side effect.
Return a job ID and expose status through a supported query API solves a different operational problem where a mobile client must poll for a long-running job result. Asynchronous job APIs avoid waiting through request timeouts. It does not directly address a single consumer writes a processed event twice after a timeout. The case calls for Enforce business idempotency keys at the destination database, since at-least-once messaging can redeliver even after a successful side effect.