Writing
Notes on distributed systems and the AI products I build. Each one started with something I built or something that broke.
- Understanding Raft, Part 1: Why Consensus Is HardGetting a few unreliable machines to agree on one sequence of events. Part 1 of the Raft series behind Crystal, my key-value store in Go.
- Understanding Raft, Part 2: Leader ElectionHow a Raft cluster elects exactly one leader and recovers when it dies. Terms as a logical clock, RequestVote, and randomized timeouts.
- Understanding Raft, Part 3: Log Replication and SafetyHow a Raft leader replicates its log with AppendEntries, what committed means, and the commit rule from Figure 8 that first implementations miss.
- Understanding Raft, Part 4: Building Crystal in GoThe paper turned into a database. Crystal's crash-safe write-ahead log, snapshots, InstallSnapshot, and the single control loop that owns consensus state.
- Go Concurrency: Goroutines, Channels and One OwnerGoroutines, channels, select and the mistakes that leak or race, from building Crystal, a Raft key-value store whose core is one goroutine.
- What You Trade When You Distribute a SystemCAP in practice, consistency as a business decision, sagas, idempotency and circuit breakers, with examples from Loom and Crystal.
- ACID in Practice: What Breaks at Each LetterWhat actually goes wrong when a transaction gives up atomicity, consistency, isolation or durability, with the PostgreSQL settings that decide it.