Skip to main content

ADR-006: CRDT for Distributed State

Status

Accepted

Context

Need eventually consistent state that survives network partitions.

Decision

Use CRDTs for user settings, plugin state, and non-critical data.

Consequences

Positive

  • Partition tolerant
  • No coordination required
  • Automatic conflict resolution

Negative

  • Eventual consistency only
  • Memory overhead
  • Limited operations

Alternatives Considered

  1. Operational Transform: Too complex
  2. Last-write-wins: Data loss
  3. Locking: Not partition tolerant

Implementation

We use various CRDT types:

  • G-Counter for view counts
  • LWW-Register for settings
  • OR-Set for plugin lists
  • RGA for collaborative text