Subodh Latkar
SERIES · 8 POSTS

Building BeeDB

I wanted to understand distributed databases, so I built one: a key–value store with a Raft implementation I wrote by hand. These posts follow that, from “a hashmap behind a socket” to three machines that survive having one of them killed. They assume nothing about Raft, and they don’t skip the parts I got wrong.

The series, in order

01
Post 01 · 7 min

Why I built a database from scratch

A coding challenge, a crush on Scylla, and the moment I wanted the harder promise.

Post 02 · 6 min

One computer isn't enough

Phone numbers, a notebook, and every wall you hit on the way to a distributed database.

Post 03 · 7 min

Certainty in uncertainty: how randomness makes Raft reliable

How three machines agree on one story, and why the answer involves rolling dice.

Post 04 · 6 min

Following one write through BeeDB

One set command, from the socket to the disk to the word STORED.

Post 05 · 7 min

What happens when the leader dies

A ten-second countdown, a silence, an election, and two writes that look identical from outside.

Post 06 · 6 min

Writing to disk without lying

Page caches, group commit, torn tails, and the fsync failure Postgres named after itself.

Post 07 · 6 min

Mistakes that taught me the most

The day time stopped, a clock that started over, and the logging that caused the outage.

Post 08 · 6 min

What BeeDB doesn't promise yet

Stale reads, at-least-once writes, no PreVote, and the durability claim I argue rather than prove.

Deep dive

02

One page with the whole system on it: the thread map, the commit rule, the gateway’s layers, and what breaks when you pull things out. Written for people who build databases, or want to see how one is put together.

Deep dive

BeeDB: the architecture

The whole system for people who build these: threads, the commit rule, the gateway, and what I would do differently.