Collaborative document concurrency

DesignHard45 minFigma and Google style

Your task

Design the concurrency control for a collaborative document store where many users edit the same record/document and you must reconcile concurrent writes without a global write lock. Use optimistic concurrency control (OCC). Constraints: ~10k concurrent editors across thousands of docs, writes must not silently overwrite each other (lost-update protection), and the common case (no conflict) should be lock-free and fast. Describe the storage/versioning, how concurrent writers detect conflicts, and what happens on a conflict.

It covers

  • Optimistic concurrency
  • Version vectors
  • Collaborative editing