by cyco130 · 4y ago · 0 comments
This would be fine in the case of email servers (you just end up sending the email twice). It seems a lot less fine in the case of Stripe transactions.
I guess, the concept of idem-potency keys can solve this issue. (https://brandur.org/idempotency-keys)
Without two phase commits I would
1) Write to the DB in the original POST request a record indicating that an email should be sent 2) Process that record outside of the original request and mark it as sent