All Questions
Elasticsearch medium

In a distributed environment, how does Elasticsearch implement 'Optimistic Concurrency Control' during a document update?

  1. A It uses global row-level locks on the Primary Shard until the replica confirms the write.
  2. B Request parameters: The client includes the `if_seq_no` and `if_primary_term` from their last read; the update is rejected if these don't match the current state on the server.
  3. C It uses a central Zookeeper instance to manage write tokens for every document.
  4. D It relies on the 'Last-Writer-Wins' strategy by comparing the system clocks of the client machines.

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

Get the app

Related questions