Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

7
  • Something like you describe is already done for you by ACID databases. Commented Dec 18, 2016 at 21:16
  • 1
    How can ACID databases help here? What does the transaction commit? There is no way to rollback sending the email if the dB transaction is not committed. Commented Dec 18, 2016 at 21:38
  • It will allow you to detect the failure to persist the event ID and avoid sending multiple emails. Commented Dec 18, 2016 at 22:17
  • Sorry Kevin I am not following, how does it do that? You could begin a transaction, persist the id (insert/update a table), send the email, attempt to commit the transaction but the commit fails. For instance if the application server lost connection the database server. Given persisting the last handled id is a single statement it is already atomic, consistant and durable. The message bus would deliver events serially so the action is isolated. I think I might be misunderstanding your solution? Commented Dec 18, 2016 at 22:27
  • I get that I can determine that the transaction failed. But if the event was redelivered, the event handler would not know that this event already created an email. bit.ly/1xiuGAb Commented Dec 18, 2016 at 22:33