Skip to main content
An RGA (Replicated Growable Array) is an ordered sequence CRDT designed for collaborative text editing. Concurrent inserts and deletes from multiple clients converge to the same result without conflicts. Each character is assigned a unique identifier at insert time. Deletions are soft (tombstoned) and removed from the visible value. Concurrent inserts at the same position are deterministically ordered by author ID.

Usage

React

Effect stream

API

Conflict semantics

  • Concurrent inserts at the same position are ordered by author ID (deterministic, total order)
  • Concurrent delete + insert: the insert survives — deletions only remove characters that existed at the time of the delete op
  • Idempotent: applying the same op twice has no effect

CRDT key prefix

Use the rg: prefix by convention: