Order service whose database write succeeds but queue publish fails

0
Remix

Design the order path of an online bookstore. When an order request arrives, the service inserts the order into its database and then publishes a message to a queue (Amazon SQS) so other parts of the system can process the order asynchronously.

  1. The database insert succeeds but the publish fails. What goes wrong, and how do you make sure every saved order is eventually published?
  2. Consumers can receive the same message more than once. How do you keep an order from being processed twice?
DatabricksTechnical phone screenLast asked Aug 2026
No answer yet. Write the first one; the best answer gets endorsed.