All Questions
Managing Long Running Tasks hard

If a worker crashes *after* charging a credit card but *before* deleting the message from the queue, the message will redeliver. How do you prevent double charging?

  1. A Delete message first.
  2. B Check a side-table 'processed_payments' with a unique transaction_id before charging. If present, skip charging and just delete the message.
  3. C Refund the user.
  4. D Use a faster server.

One system design question a day, with spaced repetition so the ones you miss come back.

Get the app

Related questions