Added
An order-processing service writes orders to an Amazon DynamoDB table and then publishes an event to an Amazon SQS queue. A failure between those operations can leave an order stored without a corresponding event. The team wants consumers to receive every committed order without introducing a separate database. Which design is the best fit?
A DynamoDB transaction can atomically persist both the order and an outbox record. DynamoDB Streams then provides a change record that a consumer can process and publish to SQS, allowing retries without losing the durable intent to publish. Retrying after a process failure cannot recover an event if the process never resumes. Publishing first can create an event for an order that was not stored. Global tables replicate DynamoDB data across Regions but do not publish to SQS.