All Questions
Multi Step Processes easy

In a multi-step workflow across different services (Order Service -> Payment Service), you cannot use a single database transaction. If the Payment fails after the Order was created, how do you fix the Order state?

  1. A Delete the entire database.
  2. B Restore the database from yesterday's backup.
  3. C Run a 'Compensating Transaction' (e.g., Cancel Order) to undo the previous step.
  4. D Ignore it; the user will try again.

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

Get the app

Related questions