Merge Northwind draft edits without merging authority
Outcome. After this optional chapter, you can explain concurrent edit semantics and preserve approval authority.
Hypothetical scenario. Priya and Dev edit a supplier policy while one laptop is offline; converging text must not silently approve the policy or restore revoked access.
In short. Choose replicated-operation semantics before applying concurrent offsets. Budget history against the supported offline interval.
Two valid edits can disagree about position
Hypothetical scenario. Two colleagues edit the same sentence while disconnected. One inserts a word near the beginning; another deletes a character using its old position. When both reconnect, applying their raw offsets in arrival order removes a different character from the one the second person intended.
This case designs a shared text document with reconnect and versioned history. Scope includes concurrent edits, synchronization, document permissions and recovery. Rich layout, spreadsheet formulas and arbitrary embedded applications are excluded. Their operation semantics need separate design.
The required contract is not merely that every client eventually displays identical bytes. The system also needs a meaningful interpretation of concurrent operations, durable accepted edits and an authority boundary for who may change the document.
Last writer wins can discard valid work
Replacing the whole document with the last arriving version is simple, but can erase another person's valid changes. A wall-clock comparison does not establish user intent, especially when devices are offline or clocks disagree.
Sending raw position edits is also insufficient because positions move as other edits apply. A reconnecting client needs the context against which its operation was defined. Treating every edit as an isolated database update hides the shared-history problem.
Decide first whether simultaneous editing is truly required. A single-owner edit or explicit version-conflict workflow can be a better product for documents where silent merging is unacceptable. Collaboration machinery is justified by the intended interaction, not by the presence of a text field.
Choose operation semantics and a sync model
Operational transformation adjusts operations against concurrent history under a specified algorithm. A conflict-free replicated data type defines state or operation behavior with convergence properties under its model. Neither name is a complete implementation specification, and mixing pieces casually can break the intended guarantees.
A Conflict-Free Replicated JSON Datatype provides one concrete research model for nested replicated data. Its data structures and assumptions matter. Convergence in that model is not proof that every application-level constraint or user-intent expectation is preserved.
Use stable document and operation identities. Persist accepted history and checkpoint state according to the chosen synchronization protocol. Clients reconnect with the required history position or causal evidence, not merely a full text blob whose origin is unknown.
Work through merge Northwind draft edits without merging authority
Collaborative editing needs an interpretation of operations under concurrency. If two clients edit by numeric offset against different histories, applying those offsets blindly can change a different character from the one the author intended. Operational transformation and conflict-free replicated data types offer different ways to reason about concurrent edits. The chosen model needs stable operation meaning, synchronization rules and a declared document object.
In a hypothetical history, the text is AB. One editor inserts X before B while another, still viewing AB, inserts Y after B. Simply replaying both old numeric offsets against each new string can misplace an insertion. A replicated-object design can attach an operation to a stable identifier or otherwise transform its interpretation against concurrent history. The point is to preserve the operation's meaning under the selected model, not to assume that arrival order expresses user intent.
History also consumes storage. Suppose ten active editors each create two operations per second, with an illustrative eighty-byte operation payload. The operation rate is 10 × 2 = 20 per second. Payload growth is 20 × 80 = 1,600 bytes per second, or 1,600 × 3,600 = 5,760,000 bytes per hour. Metadata, indexes, snapshots and replication add costs. This payload calculation is not a claim about a particular CRDT implementation's serialized size.
Compaction trades retained history against the needs of clients that can still return with older context. Define the supported offline interval and the resynchronization behavior when that interval is exceeded. An application that discards every obsolete-looking identifier can lose the information required to interpret a returning client's operations safely.
Finally, convergence is not authorization or business validity. Two clients can converge on text that contains incompatible approval statements. Keep authoritative publication or approval in a separate workflow, and check current permissions when an offline client returns. Causal context explains what history an operation saw; it does not grant the right to alter the shared policy now.
Work through a position conflict and history budget
Hypothetical scenario. Start with the three characters A,B,C at zero-based positions 0,1,2. One editor inserts X before A, producing X,A,B,C. Another editor, still viewing the original, intends to delete B at position 1. Applying its raw offset to the updated text deletes A instead. The example demonstrates why context and operation interpretation matter; it is not an implementation of either OT or a CRDT.
Under a model that preserves the intended target, inserting X and deleting B can produce X,A,C. The precise result for concurrent inserts, deletes and nested edits must be defined by the selected algorithm. Do not infer every rule from this one intuitive example.
Choose 100 concurrent editors generating two operations per second each. The service receives 100 × 2 = 200 operations per second. At a chosen 100 bytes of logical operation payload, that is 20,000 bytes per second. One hour of uncompressed retained operations is 20,000 × 3,600 = 72,000,000 bytes, or 72 MB, before metadata, indexes and replicas.
If each accepted operation is broadcast to 99 other editors, live delivery can reach 200 × 99 = 19,800 operation deliveries per second. Batching can reduce message overhead, but does not remove the logical operations recipients must interpret.
Choose a snapshot every 10,000 operations. At 200 operations per second, that count is reached in 10,000 ÷ 200 = 50 seconds under the constant-rate example. Snapshotting cannot discard history still required by offline clients unless the protocol defines a safe rebase or resynchronization path.
In the wild: Merge Northwind draft edits without merging authority
Primary evidence for merge Northwind draft edits without merging authority: Replicated JSON has a concrete conflict-free research model and assumptions.
Convergence and validity are different requirements
A merged document can converge while containing an invalid business state. Two people can independently add conflicting approval statements or change fields whose relationship must remain constrained. Separate collaborative text behavior from authoritative workflow decisions.
Presence and cursor positions are usually ephemeral observations. Do not retain them as durable document operations unless the product requires that history. A disappearing cursor does not establish that a person's last edit failed.
Deletion and compaction need particular care. Logical deletion markers or retained identifiers can be necessary for interpreting later offline operations. Garbage collection depends on the chosen algorithm and knowledge about participants, not simply elapsed age.
An offline editor returns after permission revocation
Hypothetical scenario. A user edits offline, then loses access to the document. On reconnect, a synchronization endpoint merges their operations without checking current permission because the client once possessed a valid document state.
Replication context proves neither continuing identity nor continuing authority. Validate permission at the accepted-operation boundary and define how rejected offline edits are presented to their author. The client may retain local content, but it cannot force the shared document to accept it.
Snapshots and synchronization caches can also disclose restricted content. Scope read access and history retention explicitly. An invitation revoked today cannot retroactively erase every copy already delivered, so keep that limit distinct from preventing future synchronization.
Three collaboration misconceptions
“A CRDT means no conflicts matter.” It provides particular convergence semantics. User intent, application invariants and permissions still require decisions.
“A snapshot replaces the synchronization protocol.” A snapshot records state, but clients still need compatible context to reconcile edits or a declared full-resync path.
“Receiving the same operations is enough.” Interpretation, dependencies and algorithm rules determine the result. Raw arrival order is not a universal correctness rule.
Start with a narrow collaborative object
Select a maintained implementation whose actual data model matches the product. Begin with plain text or a clearly defined structured object, then test concurrent insertion, deletion, undo, reconnect and long-offline behavior. Explain unsupported merges rather than pretending every conflict has a natural answer.
Monitor accepted and rejected operations, synchronization lag, replay cost, snapshot compatibility and history growth. Exercise restore with offline clients still holding old state. Recovery that produces readable text but cannot interpret those clients is incomplete.
Reject a custom merge algorithm built from timestamps and string offsets unless its requirements and correctness argument are genuinely established. Reject unlimited offline history without storage and permission semantics. Use explicit version conflicts when they better fit the business.
Limits of merge Northwind draft edits without merging authority
The operation-size example is a hypothetical payload budget, not a measurement of a particular replicated object. Metadata, snapshots and retained history change storage demand. Convergence applies under the selected operation model; permission and policy approval still need independent authoritative decisions.
Check yourself: review concurrent edits
A raw deletion offset refers to the original text after another insertion. What is missing?
The operation's interpretation against concurrent history. Use the chosen transformation or replicated-object model rather than applying an obsolete offset blindly.
Every client converges on a document with incompatible approvals. Did convergence enforce the business rule?
No. Convergence and application validity are different requirements. Keep authoritative approval decisions under an appropriate workflow boundary.
An offline user returns after losing access. Does causal context authorize merging?
No. It describes history. Current permission and the accepted-operation policy decide whether the shared object may change.
A convergent draft contains edits from a user whose access was revoked while offline. Should convergence decide whether they are accepted?
No. Convergence specifies how accepted operations reconcile under the replicated-object model. It does not grant authority to submit a new change. Check the returning user’s current permission and the application’s accepted-operation policy, then choose resynchronization or rejection as that policy requires. Keep approval of the resulting policy text under its own authoritative workflow.
Northwind decision log
Choose replicated-operation semantics before applying concurrent offsets.
Budget history against the supported offline interval.
Keep access and policy approval outside the convergence guarantee.
Go deeper into replicated objects and authority
- Book chapter: Grokking Concurrency, chapter 8: Solving concurrency problems: Race conditions and synchronization — Kirill Bobrov. Use Solving concurrency problems: Race conditions and synchronization when reviewing merge Northwind draft edits without merging authority.
- Book chapter: Grokking Concurrency, chapter 12: Asynchronous communication — Kirill Bobrov. Use Asynchronous communication when reviewing merge Northwind draft edits without merging authority.
- Video lecture: Distributed Systems 4.1: Logical time — Martin Kleppmann. Watch for the ordering and concurrent-operation model.
- Primary paper: A Conflict-Free Replicated JSON Datatype — Martin Kleppmann and Alastair Beresford. Study its concrete data model and assumptions.
Related blog: MCP vs. A2A in Plain English: What Each Protocol Connects and What It Leaves to You.