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.
Sole owner: Max McCutcheon
MaxMcCutcheon1@outlook.comDesign
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.
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.
Append-before-memtable. EveryWrite by default; group-commit optional. If we die after fsync but before memtable insert, replay restores the ACK’d write.
Data blocks → bloom meta → index → 48-byte footer with magic SPNDLSST. Sparse index, restart-interval prefix compression, trailing CRC.
Leveled ×10. L0 file-count trigger and per-level byte thresholds. Tombstones drop only at the bottom level.
Compaction keeps every version a live snapshot can still see, so a long-lived snapshot holds old data on disk until it is dropped.