All Questions
Dealing With Contention medium

How does Optimistic Locking handle concurrent updates without blocking?

  1. A It uses a `version` number or timestamp. When updating, it checks `WHERE version = read_version`. If the count is 0 (version changed by someone else), the update fails and the client must retry.
  2. B It hopes no one else updates the row.
  3. C It locks the table but allows reads.
  4. D It uses a distinct separate database.

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

Get the app

Related questions