Consensus Playground
Simulate a KRaft quorum in your browser. No backend, no cluster, no install.
Krabka's metadata quorum is a native KRaft implementation. Its core is deterministic: the same sequence of events always produces the same state. That property makes the consensus engine testable, and it also lets the engine run in a browser. The engine on this page is the engine that runs in the broker.
The panel below compiles the deterministic core to WebAssembly and drives it from JavaScript over an in-memory bus. The peers do not use TCP. The page owns the clock and the transport, so it can inject faults at any point and step the cluster forward one message at a time.
Loading the interactive consensus simulator. This panel needs JavaScript and WebAssembly. If it does not appear, your browser may have them disabled.
What to try
Press Play and watch a fresh cluster hold its first election. Then cut off the leader with Partition leader. The majority elects a new leader at a higher epoch. Click the dimmed node to heal the partition. The stale leader then steps down, because the engine never allows two leaders in one epoch.
| Control | What it does to the cluster |
|---|---|
| Partition leader | Cuts the leader off the bus. Its in-flight messages are dropped, and it can neither send nor receive. |
| Heal | Reconnects a partitioned node. The stale leader sees the higher epoch and steps down. |
| Drop next | Discards the next in-flight message instead of delivering it. |
| Reorder | Delivers every queued message back to front, so delivery is not FIFO. |
| Duplicate next | Delivers the next in-flight message twice. |
| Append | Appends records on the current leader and replicates them. |
How it works
- The browser UI triggers a fault or a step.
- The WASM consensus core applies it and returns the resulting cluster state as JSON.
- A JavaScript in-memory bus carries the messages between the simulated peers.
- The page renders the new state and appends the event to the timeline.
Every action drives the real KIP-595 and KIP-996 state machine. Nothing on this page is a
scripted animation. The crate that binds the core to JavaScript is
krabka-playground, and it lives in
playground/ in this repository. The site build
compiles it with npm run build:playground.