Skip to content

Blog

Append Only

A blob store that never overwrites a record, so a crash can only ever cost you the last write.

The scariest moment for a datastore is the one where the power goes out mid-write. If your store overwrites data in place, that moment can shred a record that was already safe. The fifteenth familiar refuses to overwrite a record, ever: it only appends. A crash can lose the write in flight, and nothing else, and that single discipline turns crash safety from a hope into a guarantee of the format.

The Seam

An HTTP/1.1 framework that streams requests in, and buffers replies out unless asked to stream.

Most HTTP frameworks make you think about the server. This one gives you exactly one thing to implement, a handler that takes a request and writes a response, and hides the socket, the parser, and the event loop behind that seam. The fourteenth familiar streams where it has to, on the way in, so a multi-gigabyte restore never sits in memory, and buffers on the way out by default, which is what gives a reply its ETag, its byte ranges and its compression. A reply too big to hold can stream too.

One Loop Per Core

The part of every TCP server you keep rewriting, written once.

Every TCP server re-implements the same three unglamorous things: a pool of event loops across the cores, the accept loop that fans connections out to them, and the shutdown dance that tears it down without hanging. None of that is your protocol, and all of it is where the concurrency bugs live. The thirteenth familiar owns exactly that and nothing else, so a new protocol is a coroutine, not a runtime.

Interchangeable Parts

Three compression formats behind one interface, swapped by changing a single word.

Compression is a set of tradeoffs, interop versus speed versus ratio, and the honest answer is 'it depends,' which is useless if switching backends means rewriting your call sites. The twelfth familiar puts three incompatible formats behind one identical shape, so choosing between deflate, lz4, and zstd is a matter of changing a single word in your code, and nothing else.

The Shunting Yard

Turning a boolean query into something a machine can walk, in one pass over two stacks.

Infix is how people write boolean queries and the worst way to evaluate them, because precedence and parentheses mean you cannot just read left to right. Dijkstra's shunting-yard algorithm fixes that in a single pass with two stacks, reshuffling 'a OR (b AND NOT c)' into a form a machine walks without ever recursing. The eleventh familiar is that algorithm, and the query language it feeds never needs the parse tree at all.