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
- Operational Transform: Too complex
- Last-write-wins: Data loss
- 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