Operational Concurrency Control in the Face of Arbitrary Scale and Latency

James Smith · DOI

Abstract

We present for the first time a complete solution to the problem of proving the correctness of a concurrency control algorithm for collaborative text editors against the standard consistency model. The success of our approach stems from the use of comprehensive stringwise operational transformations, which appear to have escaped a formal treatment until now. Because these transformations sometimes lead to an increase in the number of operations as they are transformed, we cannot use inductive methods and adopt the novel idea of decreasing diagrams instead. We also base our algorithm on a client-server model rather than a peer-to-peer one, which leads to the correct application of operational transformations to both newly generated and pending operations. And lastly we solve the problem of latency, so that our algorithm works perfectly in practice. The result of these innovations is the first ever formally correct concurrency control algorithm for collaborative text editors together with a fast, fault tolerant and highly scalable implementation.

Introduction

Collaborative text editing, a cornerstone of modern productivity tools like Google Docs, relies on Operational Transformation (OT) to maintain document consistency across multiple users. The primary challenge is ensuring the CCI model: Convergence (all users see the same state), Causality (edits appear in logical order), and Intention Preservation (the effect of an edit matches the user's original intent).

Despite its widespread use, OT has a history of formal correctness issues. Since 1989, many proposed algorithms have been found flawed. Most formal research has focused on character-by-character operations, which are mathematically simpler but computationally inefficient. Practical systems require stringwise operations, which handle blocks of text but introduce "fragmentation"—a phenomenon where one operation splits into multiple operations during transformation, complicating formal proofs.

The Concur Algorithm

The paper introduces Concur, an algorithm that achieves formal correctness by departing from traditional peer-to-peer (P2P) research directions in three key ways:

1. Stringwise Transformations and Fragmentation

Unlike previous models that avoid operation splitting to simplify induction, Concur embraces fragmentation. When an insertion occurs within the range of a deletion, the deletion must be split to preserve its intent. To prove correctness despite this increase in operation count, the author employs decreasing diagrams from term rewriting theory, bypassing the limitations of standard inductive proofs.

Stringwise transformation and fragmentation: a delete operation is split by an insertion.

2. Client-Server Architecture

While the academic community has long favored P2P models for decentralization, Concur utilizes a client-server model. This choice allows the server to establish a total ordering of operations, significantly simplifying the transformation logic and avoiding the "unreasonable correctness criteria" (like the TP2 property) that have historically hindered P2P proofs.

3. Dual-Copy Latency Management

To ensure a responsive user experience despite network lag, each client maintains two document versions:

  • Working Copy: Synchronized with the server's state.
  • Editable Copy: The local UI state that the user interacts with immediately. This dual-copy approach allows local edits to be applied instantly while background synchronization handles transformations against concurrent remote edits.

Key Insights

  • Embracing Complexity: The "Aha!" moment of the research was realizing that fragmentation is not a bug to be avoided but a requirement for correctness.
  • Simplified Tie-Breaking: For simultaneous insertions at the same position, Concur uses a simple lexicographical comparison of the strings. This ensures convergence without the need for complex metadata tracking.
  • Practical Scalability: By moving away from characterwise P2P systems, the algorithm achieves high performance and fault tolerance suitable for large-scale deployments.

Results and Formal Correctness

The paper provides the first formal proof that a stringwise OT algorithm satisfies the full CCI model.

  • Convergence: Guaranteed through the server's total ordering and deterministic tie-breaking.
  • Causality: Maintained by the protocol's handling of operation dependencies.
  • Intention Preservation: Formally verified even in the presence of operation fragmentation.

Limitations and Future Work

While a major milestone, Concur currently focuses on plain text. Modern collaborative environments involving rich text, embedded media, and complex data structures (like tables) present additional layers of complexity. Furthermore, while the algorithm is fault-tolerant, handling extended offline periods and complex semantic merge conflicts remains an area for future exploration. The author also notes that "intention preservation" is a technical guarantee; it ensures characters are placed correctly but cannot prevent human-level semantic conflicts where two valid edits result in a nonsensical sentence.

Summary updated

BibTeX
@misc{smith2013operational,
  author = {James Smith},
  title = {{Operational Concurrency Control in the Face of Arbitrary Scale and Latency}},
  year = {2013},
  eprint = {1303.7462},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1303.7462},
}
Figure