LSM 01-02: The Memtable and the Log

The Data Systems storage-engines board. This lesson builds its top half: the sorted buffer writes land in, and the log that makes the buffer safe. Part of the LSM series, Build Your Own LSM Tree.
Before you start. This series builds a small copy of a storage engine that never edits a file in place. Build Your Own LSM Tree has the map. You need one idea from Write-Ahead Log: a note must reach the disk before the action it describes, and “reach the disk” means fsync, not just write. Nothing else is assumed.