A strongly consistent key-value database in Go on the Raft consensus algorithm. Rather than assuming it works, a deterministic simulator crashes nodes, splits the network and loses, duplicates and reorders messages, then checks that every client history is linearizable. The same Go code runs in the browser through WebAssembly, so you can break the cluster yourself.
02The system
What I built
Clientexactly-once retries
Leaderelection, replication
Write-ahead logfsynced, snapshots
Chaos simulatorsafety checks every tick
LinearizabilityPorcupine checker
Raft as a pure state machine: leader election, log replication, snapshots and log compaction
An fsynced write-ahead log that survives torn writes, and exactly-once client retries
A seeded chaos simulator with per-tick safety checks and Porcupine linearizability checking
An HTTP server with leader redirects, a load benchmark, and an interactive WebAssembly lab
03The result
What it achieved
1,000 of 1,000 chaos runs safe and linearizable across 11,075 crashes, 5,238 partitions and 518k client operations. Group commit took a 3-node cluster from 96 to 2,003 fsynced writes/s (p50 31 ms), and replication flow control cut network messages 10x.