System Design Atlas

Collaborative documents with offline edits

07 / 10Worked example

Critical flow

How is an accepted change recognized after lost confirmation?

We track the error point through the architecture: Server accepts O-91, the response is lost. Device still shows pending and queries the same change state. After reply, confirmed appears; a later permission withdrawal does not remove the already confirmed historical change. Durable acceptance, actual effect and response are considered individually.

Starting point Operate connection management and merging separately.

Assumptions for the example case

Our own fictitious example design: A text document with a character sequence and comments; several devices per person; deterministic merging; server-side checked permissions during synchronization. Figures and quality goals are illustrative test assumptions. Outside are table formulas, encrypted end-to-end cooperation and automatic content conflict resolution.

Failure point in the sequence

Offline operation, acceptance commit and status matching

O-91 is accepted before confirmation reaches G-91.

G-91
Gateway
Change/rights storage
Merge Worker
  1. 01 G-91 · Local processingO-91 locally pending
  2. 02 G-91 → GatewayO-91 · X
  3. 03 Gateway → Change/rights storageCheck permission + commit O-91
  4. 04 Change/rights storage → Gatewaybestätigt
  5. 05 Gateway · Local processingAnswer is lost
  6. 06 G-91 → GatewayO-91 again / status query
  7. 07 Gateway → G-91Historically confirmed
  8. 08 Merge Worker → Change/rights storageO-91 + O-92 → AXYB

Result: O-91 takes effect once; a later deprivation of rights does not remove the confirmed history.

A device state is pending; the operation is only confirmed by the server-side document.

O-91 is accepted, device does not know it yet. Retrieve confirmed change state. Retry does not produce a second X.

Effect, response and recovery

Specific error
Server accepts O-91, the response is lost. Device still shows pending and queries the same change state. After reply, confirmed appears; a later permission withdrawal does not remove the already confirmed historical change.
Before and after commit
Commit durably completes the local change. Before commit, the old state remains valid; afterwards, an identical retry returns the stored outcome. Reconcile the external effect using its existing reference.
Retry behaviour
Synchronize O-91 with identical content twice: X appears once. The same identity with Z instead of X is rejected. Rejected change remains locally exportable and will not be valid by Retry.

Survive response loss

Survive response loss

Query the confirmed change state again.

O-91 is accepted, device does not know it yet.

Retry does not produce a second X.

Alternative considered
New change counter at Timeout doubles text.
Trade-off
The device keeps pending data longer.
Reassess
Device storage limits are reached.

Terms in this step

Survive response loss
Retry does not produce a second X.

Try it yourself

Server accepts O-91, response is lost. Which action clarifies the state and how often does X appear?

A hint for your attempt

Use the specific entities and conditions from this step. The two solution parts distinguish the decision from its evidenced outcome.

Compare with a possible solution
First part of the solution
Device queries the same confirmed change state or repeats O-91 identically.
Second part of the solution
X appears once; after confirmation, the local status changes from pending to confirmed.

Apply to your project

Which corresponding assumption in your project would you check first? Use as an occasion: Device storage limits are reached.

Step 8 Examined: Condense history carefully.