blurb

Random bits and pieces about programming.

KV Store Performance Improvements

Background Almost two years ago I decided that I wanted to write my own key-value store from scratch, however, I never got the chance to profile the code and make any performance improvements. Recently, I got an itch to look at some flamegraphs so I decided that this would be the perfect opportunity to see if I can speed things up a bit. I recommend reading the previous post to get a better understanding of the work done here....

January 20, 2025 · 1494 words · agao

A Year of Reading (2024)

I thought it’d be fun to revisit some of the best books and blogs I read this year. Designing Data Intensive Applications by Martin Kleppmann. One of the most recommended books for learning distributed systems. I think it gives a pretty comprehensive overview of everything someone should know. I would use it more as a reference book and read chapters based on interest. Bitcask. This was one of the first papers I read this year....

December 30, 2024 · 573 words · agao

Writing a Crappy SQL Database from Scratch

Surprisingly, I’ve never had to write much SQL (i.e. any) in any of my previous jobs or current job before. So I thought it would be fun to get my hands dirty and try implementing a subset of SQL with an in-memory backend. It mostly follows from this blog post. But, I also wasn’t super interested in writing my own SQL parser, so I decided to use a fork of Vitess’ sqlparser library....

November 10, 2024 · 1244 words · agao

Taming Randomness With Hello World

2024/11/17: Updated to include support for mutexes. There is a lot of nondeterminism (or randomness) in modern software, from the obvious like random number generation to the less obvious like syscalls, scheduling and network latency. This makes debugging and troubleshooting very troublesome especially in distributed systems where multiple machines and networks are involved. However, if we could somehow control this randomness, then this would allow us to reproduce issues at will, no matter how rare or difficult....

July 5, 2024 · 1866 words · agao

Writing a Key-Value Store From Scratch

A few months ago I was inspired by this post on how RocksDB works, and decided that it would be a fun exercise to implement a database myself. This post is more of a documentation of how I built my own key-value store, but I still hope to give an overview of how they work, and provide enough details for someone to implement one themselves. The database and code snippets are written in Go, and the source code can be found here....

August 23, 2023 · 2653 words · agao