An interactive visualization tool for exploring Conflict-free Replicated Data Types (CRDTs) and their behavior under chaotic network conditions.
Visit the live demo at: https://YOUR-USERNAME.github.io/crdt/
- G-Counter CRDT Implementation: A grow-only counter that demonstrates basic CRDT principles
- Chaos Controls 🐵:
- Drop Rate: Simulate packet loss
- Delays: Add network latency
- Duplicates: Test idempotency
- Network Partitions: Isolate nodes completely
- Auto-Increment 🤖: Automated testing with configurable intervals
- Real-time Convergence Graph: Visualize how nodes converge over time
- Interactive Nodes: Three independent nodes (A, B, C) that sync their state
CRDTs are data structures that can be replicated across multiple nodes in a distributed system, where each replica can be updated independently and concurrently without coordination. Despite network failures, delays, or partitions, CRDTs guarantee eventual consistency - all nodes will converge to the same state once they can communicate.
- Manual Testing: Click "Increment" on any node to increase its counter
- Automated Testing: Use "Start Auto-Increment" to make nodes increment automatically
- Add Chaos: Adjust the chaos controls to simulate real network conditions
- Create Partitions: Isolate nodes to simulate network splits
- Watch Convergence: The graph shows how nodes diverge and reconverge
- Perfect Network: Start with no chaos - watch perfect synchronization
- Packet Loss: Set 50% drop rate - see how nodes handle missing updates
- Network Partition: Isolate Node A, let others continue, then reconnect
- Chaos Storm: Max out all chaos controls and watch CRDTs maintain consistency
- Partition Healing: Create divergence, then remove all chaos to see convergence
This visualizer implements a G-Counter (Grow-only Counter) CRDT using:
- State-based replication (nodes share their full state)
- Vector clock-like structure (each node tracks its own count)
- Merge operation using
max()
for convergence
The implementation demonstrates key CRDT properties:
- Commutativity: Order of merges doesn't matter
- Associativity: Grouping of merges doesn't matter
- Idempotency: Merging the same state multiple times is safe
Simply open chaos-counter.html
in a web browser. No build process or dependencies required!
- The Evolution of CRDTs - A comprehensive overview of CRDT technology
- CRDT Tech - Introduction to CRDTs
- Wikipedia: CRDT