Table of Contents
Fetching ...

Extending JSON CRDTs with Move Operations

Liangrun Da, Martin Kleppmann

TL;DR

An algorithm for move operations in a JSON CRDT that handles the interaction with concurrent non-move operations, and uses novel optimisations to improve performance is introduced and integrated into the Automerge CRDT library.

Abstract

Conflict-Free Replicated Data Types (CRDTs) for JSON allow users to concurrently update a JSON document and automatically merge the updates into a consistent state. Moving a subtree in a map or reordering elements in a list within a JSON CRDT is challenging: naive merge algorithms may introduce unexpected results such as duplicates or cycles. In this paper, we introduce an algorithm for move operations in a JSON CRDT that handles the interaction with concurrent non-move operations, and uses novel optimisations to improve performance. We plan to integrate this algorithm into the Automerge CRDT library.

Extending JSON CRDTs with Move Operations

TL;DR

An algorithm for move operations in a JSON CRDT that handles the interaction with concurrent non-move operations, and uses novel optimisations to improve performance is introduced and integrated into the Automerge CRDT library.

Abstract

Conflict-Free Replicated Data Types (CRDTs) for JSON allow users to concurrently update a JSON document and automatically merge the updates into a consistent state. Moving a subtree in a map or reordering elements in a list within a JSON CRDT is challenging: naive merge algorithms may introduce unexpected results such as duplicates or cycles. In this paper, we introduce an algorithm for move operations in a JSON CRDT that handles the interaction with concurrent non-move operations, and uses novel optimisations to improve performance. We plan to integrate this algorithm into the Automerge CRDT library.
Paper Structure (16 sections, 4 figures)

This paper contains 16 sections, 4 figures.

Figures (4)

  • Figure 1: Initially, nodes $A$ and $B$ are siblings. Replica 1 moves $B$ to be a child of $A$, while concurrently replica 2 moves $A$ to be a child of $B$. Boxes (a) to (d) show possible outcomes after the replicas have communicated and merged their states: (a) A and B form a cycle; (b) concurrently moved subtrees are duplicated; (c) Replica 2's move is ignored; (d) Replica 1's move is ignored. Figure from kleppmann2021highly.
  • Figure 2: An example JSON document with its internal OpSet
  • Figure 3: Convergence time of two actors that diverge by move operations
  • Figure 4: Convergence time of two actors that diverge by non-move operations