Preparing your design workspace

Loading the problem and your latest saved attempt…

Single-Editor Document Instance Routing

Scale a document editor beyond user URLs tied to physical instances while preserving one active editor and durable saves per document.

Problem statement

The report describes a document editor with 100 instances assigned to users, an instance number embedded in a user editing URL, and only one active editor per document. A user may work on several documents. Explain how the service behaves as users grow and instances fail.

For this exercise, assume authenticated users open authorized plain-text documents, acquire exclusive editing, and save complete text versions. Other users may read but receive a busy outcome when another active editor holds that document.

Accepted saves must be durable and recoverable after a lost response; an expired or replaced editor must not overwrite a newer save. Treat 100 instances as the starting fleet, preserve old links through routing changes, and allow added capacity. Keep unsaved client text explicit rather than claiming server durability.

Concurrent collaborative edits, OT/CRDT, comments, media objects and rich-text transformations are outside scope.

What to build

  1. An authorized user can open a document and acquire exclusive editing, or observe that another active editor holds it.
  2. The active editor can save a version durably and recover its exact outcome after retries or a lost response.
  3. Users can reopen existing links after placement changes or instance failure without granting two active save authorities.

At scale

  • For this exercise, start with 100 editing instances and grow to 20,000 simultaneous active editors across 1 million documents; one document may be opened by many readers but has only one active editor.
  • For this exercise, documents are at most 1 MiB and the fleet accepts up to 2,000 complete-text saves/s, so placement must account for memory and byte work as well as session count.
  • For this exercise, target 300 ms p95 for a healthy open or save and resume authorized editing within 60 seconds after one instance failure; acknowledged versions survive that failure.
  • For this exercise, a 30-second renewable edit lease is renewed every 10 seconds using authority time; any equivalent explicit ownership mechanism may be defended, and unsaved client text has no server durability promise.