GitHub Open console

Writing

Notes from building a database from scratch — one layer at a time, including the parts that were wrong the first time.

Sep 8, 2026 · engineering

kill -9, in a loop

A durability claim you have not tried to break is a hypothesis. Here's the harness that tries.

Sep 3, 2026 · engineering

Writing an SSTable

Entries, then an index, then eight bytes at the very end that tell you where the index starts.

Aug 31, 2026 · engineering

flush() is not fsync()

The log was appending correctly, replaying correctly, and passing its tests — and would still have lost data on power loss.

Feb 22, 2026 · engineering

The write-ahead log, byte by byte

Four bytes of length, then the key, then four bytes of length, then the value. And one number that means "this was a delete".