All Questions
Redis medium

Redis transactions (`MULTI/EXEC`) do not support rollback. How does the `WATCH` command address data integrity during concurrent updates?

  1. A It acquires a Pessimistic Lock on the key, blocking all other clients until the transaction finishes.
  2. B It implements Optimistic Locking by aborting the transaction if the watched key is modified externally.
  3. C It creates a temporary in-memory clone of the entire database to ensure total snapshot isolation.
  4. D It forces all other connections to wait in a global kernel-level semaphore queue until `EXEC` is called.

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

Get the app

Related questions