System Design Atlas

Collaborative documents with offline edits

10 / 10Worked example

Design and evidence

Which tests demonstrate convergence while respecting current write permissions?

The final design reuses the complete runtime topology from step 6. Test markers connect key decisions to expected results and earlier steps to revisit. The following items form a test plan; measured evidence is still outstanding.

Starting point Keep rejected changes exportable.

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.

Overall architecture with evidence

Runtime Architecture · Local replicas and server-side adoption

  1. 1 · Store locally
  2. 2 · Examining the right
  3. 3 · Operation commits
  4. 4 · merge and distribute
Editor devicesLocal change store

Collaboration platform

Synchronization gatewayAcceptance + fan-out
Change and rights repositoriesOperations + Grants + Snapshots
Merge workerDeterministic view
Identity serviceAuthentication
Editor devices → Synchronization gatewaypending operations
Synchronization gateway → Editor devicesConfirmation + Operations
Synchronization gateway → Change and rights repositoriesCommit acceptance
Change and rights repositories → Merge workerAccepted changes
Merge worker → Change and rights repositoriesView + Snapshot
Synchronization gateway → Identity serviceCheck authentication
Convergence · Step 5Replay · Step 4Response loss · Step 7

Devices save offline; the gateway validates acceptance; the worker builds views from accepted changes.

Many connections face few documents. Manage connections and merge separately. Long connections do not block snapshot work.

Test plan with review loops

ValidationExpected resultReturn to an earlier step
Concurrency in both ordersO-91 and O-92 in both delivery sequences and with duplicates: all confirmed replicas show AXYB. Withdrawal of rights before acceptance rejects the new change; acceptance before withdrawal remains historically confirmed.Steps 3 and 5
Identical and changed retriesSynchronize 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.Step 4
Exact value or time limitA single change may contain at most 65,536 UTF-8 bytes: accept 65,535 and 65,536; reject 65,537. Character count and byte count are separate; truncated multibyte characters are invalid.Steps 2 and 5
Lost response and restartServer 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.Steps 7 and 9

Concurrency in both orders

Expected result
O-91 and O-92 in both delivery sequences and with duplicates: all confirmed replicas show AXYB. Withdrawal of rights before acceptance rejects the new change; acceptance before withdrawal remains historically confirmed.
Return to an earlier step
Steps 3 and 5

Identical and changed retries

Expected result
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.
Return to an earlier step
Step 4

Exact value or time limit

Expected result
A single change may contain at most 65,536 UTF-8 bytes: accept 65,535 and 65,536; reject 65,537. Character count and byte count are separate; truncated multibyte characters are invalid.
Return to an earlier step
Steps 2 and 5

Lost response and restart

Expected result
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.
Return to an earlier step
Steps 7 and 9

First end-to-end validation

End-to-end path
Edit on both devices offline and reconnect them in both orders. AXYB results exactly once from both changes.
Open decision
After that, deletion and formatting are checked separately. Table formulas, encrypted end-to-end cooperation and automatic content conflict resolution require their own follow-up draft.

Test convergence

Test convergence

Edit on both devices offline and reconnect them in both orders.

Normal operation shows no delivery sequences.

AXYB arises exactly once from both changes.

Alternative considered
An online single device test does not test for replication.
Trade-off
Tests require independent local conditions.
Reassess
After that, deletion and formatting are checked separately.

Terms in this step

Test convergence
AXYB arises exactly once from both changes.

Try it yourself

Name one convergence test and one permissions test, each with its expected result and the design step to revisit.

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
O-91/O-92 in both orders plus duplicates: AXYB on all confirmed replicas; error to step 2/4.
Second part of the solution
Withdrawal before acceptance: reject the change and retain it locally; failures lead back to step 5/9. Technical integration preserves the permission checks.

Apply to your project

Which corresponding assumption in your project would you check first? Use as an occasion: After that, deletion and formatting are checked separately.

Transfer the system boundary, evidence and open decisions to the editable Markdown design template.

Start your own design

Choose a small case from your project. The template collects the ten design tasks and leaves space for your sketches, decisions, and open assumptions. You can edit it in your text editor or note-taking app.

Download design template (.md)
Compare the ten tasks with the example case
  1. Purpose and boundary

    Which corresponding assumption in your project would you check first? Use as an occasion: User tests show misleading status display.

    In the example: Display pending and confirmed changes separately. Offline work is preserved and its confirmation status stays clear.

  2. Requirements

    Which corresponding assumption in your project would you check first? Use as an occasion: Content conflicts need additional moderation.

    In the example: Define a deterministic merge rule. Both delivery orders produce AXYB.

  3. Scale estimates

    Which corresponding assumption in your project would you check first? Use as an occasion: large events exceed 50 editors.

    In the example: Test document hotspots separately from overall load. 100 changes/s can reach many recipients.

  4. Interfaces

    Which corresponding assumption in your project would you check first? Use as an occasion: Device change requires a regulated new identity.

    In the example: Compare identity and canonical payload. X is accepted once; Z under the same identity is rejected.

  5. Data and states

    Which corresponding assumption in your project would you check first? Use as an occasion: An explicit offline contract is agreed.

    In the example: Check current permissions when the server commits. A change submitted later may be rejected.

  6. Overall architecture

    Which corresponding assumption in your project would you check first? Use as an occasion: Small teams allow easier operation.

    In the example: Operate connection management and merging separately. Long-lived connections do not block snapshot processing.

  7. Critical flow

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

    In the example: Query the confirmed change state again. A retry does not create a second X.

  8. Bottlenecks and trade-offs

    Which corresponding assumption in your project would you check first? Use as an occasion: Very long-offline devices exceed the history retention period.

    In the example: Create snapshots with an explicit included revision. Changes still missing remain eligible for later delivery.

  9. Operations and security

    Which corresponding assumption in your project would you check first? Use as an occasion: Data protection rules limit local storage.

    In the example: Keep rejected changes exportable. The content remains accessible without being merged without permission.

  10. Final design

    Which corresponding assumption in your project would you check first? Use as an occasion: After that, deletion and formatting are checked separately.

    In the example: Edit on both devices offline and reconnect them in both orders. AXYB results exactly once from both changes.