storage
Write-Ahead Log (WAL)
Log operations before applying — enables crash recovery by replaying the WAL from disk.
WAL entries0
store entries0
status✓ RUNNING
💾 WAL (on disk — survives crash)
empty
🧠 Store (in memory)
empty
// event log
No events yet
How It Works
- All writes logged to WAL first (durable)
- Then applied to in-memory store
- On crash: replay WAL to restore state
- WAL is append-only → sequential I/O (fast)
Use Cases
- PostgreSQL, SQLite, MySQL InnoDB
- Raft/Paxos log replication
- Kafka commit log
- Any durable state machine