In a storage engine the interesting property is not speed, it's the contract: an acknowledged write exists after any crash, and recovery never invents data. The engine below is the real library, WAL, memtables, SSTables, group commit, compaction, compiled to WebAssembly, wearing the same byte-exact crash gate its test suite uses. Cut its power and see.
12 configs × 1,000 kills on every CI push · bench/results/crash_matrix.txt · raw YCSB CSVs in the repo
Fig. 1. What's on disk, live: the write-ahead log accretes at the top, memtable flushes harden into L0 tables, compaction fuses them into the leveled strata below. The power cut arms the same fault-injection gate as tools/crash_test, a byte offset inside the engine's own write path; everything acknowledged before the tear must survive the reboot, with every value byte-identical. The browser filesystem is in-memory: the durability mechanics (WAL bytes, torn-tail truncation, replay) are real, but throughput here is not a disk number; the measured numbers above come from real hardware, see docs/BENCHMARKS.md.
// keys and values land in the real memtable; puts are acknowledged after the WAL write
Fig. 2. Every put is a WAL record and a skiplist insert; every get walks memtables, then the levels, bloom filters first. Delete writes a tombstone that survives until compaction drops it at the bottommost level.
| write amplification | – |
| flushes | 0 |
| compactions | 0 |
| write stalls | 0ms |
| bloom skips | – |
| block-cache hits | – |
Backpressure is visible here: pile up L0 files without compacting and the engine stalls writes rather than OOM.
src/util/env.ccsrc/wal/wal_reader.cc, src/wal/wal_writer.ccsrc/db/memtable.cc, src/table/table_builder.cc,
src/db/version.ccsrc/db/db_impl.cc, src/util/crc32c.cc