All Questions
Multi Step Processes hard

A worker processes a message for 5 minutes. The Queue Visibility Timeout is 1 minute. The queue redelivers the message to a second worker. Now two workers are processing the same data concurrently. How do you prevent the first worker from corrupting the state when it finally finishes?

  1. A Increase the timeout to 10 minutes.
  2. B Kill the first worker.
  3. C Optimistic Locking (Version Numbers) on the database rows.
  4. D Use a FIFO queue.

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

Get the app

Related questions