All Questions
Managing Long Running Tasks hard

How do you atomically update your local database AND publish a message to a queue without losing sync if the process crashes in between?

  1. A Outbox Pattern. Insert the message into an 'Outbox' table in the SAME database transaction as the business data. A separate background process reads the Outbox and pushes to the Queue.
  2. B Publish first, then commit DB.
  3. C Commit DB first, then publish.
  4. D Use Redis.

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

Get the app

Related questions