Table of Contents
Fetching ...

Collaborative Text Editing with Eg-walker: Better, Faster, Smaller

Joseph Gentle, Martin Kleppmann

TL;DR

Eg-walker is introduced, a collaboration algorithm for text that avoids weaknesses in existing CRDT algorithms, and offers performance that is competitive with centralised algorithms, paving the way towards the widespread adoption of peer-to-peer collaboration software.

Abstract

Collaborative text editing algorithms allow several users to concurrently modify a text file, and automatically merge concurrent edits into a consistent state. Existing algorithms fall in two categories: Operational Transformation (OT) algorithms are slow to merge files that have diverged substantially due to offline editing; CRDTs are slow to load and consume a lot of memory. We introduce Eg-walker, a collaboration algorithm for text that avoids these weaknesses. Compared to existing CRDTs, it consumes an order of magnitude less memory in the steady state, and loading a document from disk is orders of magnitude faster. Compared to OT, merging long-running branches is orders of magnitude faster. In the worst case, the merging performance of Eg-walker is comparable with existing CRDT algorithms. Eg-walker can be used everywhere CRDTs are used, including peer-to-peer systems without a central server. By offering performance that is competitive with centralised algorithms, our result paves the way towards the widespread adoption of peer-to-peer collaboration software.

Collaborative Text Editing with Eg-walker: Better, Faster, Smaller

TL;DR

Eg-walker is introduced, a collaboration algorithm for text that avoids weaknesses in existing CRDT algorithms, and offers performance that is competitive with centralised algorithms, paving the way towards the widespread adoption of peer-to-peer collaboration software.

Abstract

Collaborative text editing algorithms allow several users to concurrently modify a text file, and automatically merge concurrent edits into a consistent state. Existing algorithms fall in two categories: Operational Transformation (OT) algorithms are slow to merge files that have diverged substantially due to offline editing; CRDTs are slow to load and consume a lot of memory. We introduce Eg-walker, a collaboration algorithm for text that avoids these weaknesses. Compared to existing CRDTs, it consumes an order of magnitude less memory in the steady state, and loading a document from disk is orders of magnitude faster. Compared to OT, merging long-running branches is orders of magnitude faster. In the worst case, the merging performance of Eg-walker is comparable with existing CRDT algorithms. Eg-walker can be used everywhere CRDTs are used, including peer-to-peer systems without a central server. By offering performance that is competitive with centralised algorithms, our result paves the way towards the widespread adoption of peer-to-peer collaboration software.
Paper Structure (44 sections, 8 theorems, 5 equations, 12 figures, 3 tables)

This paper contains 44 sections, 8 theorems, 5 equations, 12 figures, 3 tables.

Key Result

lemma 1

Let $e$ be an event in a valid event graph such that $e.\mathit{op} = \mathit{Delete}(i)$. In the internal state immediately before applying $e$ (in which all events that happened before $e$ have been advanced and all others have been retreated), either the record that $e$ will update has $s_p = \te

Figures (12)

  • Figure 1: Two concurrent insertions into a text document.
  • Figure 2: The event graph corresponding to \ref{['two-inserts']}.
  • Figure 3: An event graph (left) and one possible topologically sorted order of that graph (right).
  • Figure 4: An event graph. Starting with document "hi", one user changes "hi" to "hey", while concurrently another user capitalises the "H". After merging to the state "Hey", one of them appends an exclamation mark to produce "Hey!".
  • Figure 5: State machine for internal state variable $s_p$.
  • ...and 7 more figures

Theorems & Definitions (10)

  • definition 1
  • definition 2
  • lemma 1
  • lemma 2
  • lemma 3
  • lemma 4
  • lemma 5
  • lemma 6
  • lemma 7
  • theorem 1