Sole owner: Max McCutcheon

MaxMcCutcheon1@outlook.com

Design

Defend every choice.

Spindle’s interview value is being able to walk the write path, the crash story, and the compaction amp without flipping open a wiki. This page is the short map — the long form lives in the repo.

Memtable

BTreeMap with tombstones under a single writer and a reader-writer lock, held only for one insert. Deletes stay until compaction so older snapshots remain correct.

WAL + fsync

Append-before-memtable. EveryWrite by default; group-commit optional. If we die after fsync but before memtable insert, replay restores the ACK’d write.

SSTable layout

Data blocks → bloom meta → index → 48-byte footer with magic SPNDLSST. Sparse index, restart-interval prefix compression, trailing CRC.

Compaction

Leveled ×10. L0 file-count trigger and per-level byte thresholds. Tombstones drop only at the bottom level.

Snapshots pin old versions

Compaction keeps every version a live snapshot can still see, so a long-lived snapshot holds old data on disk until it is dropped.