Log Structured B-Tree

Some years ago I worked for a company making an analytical SQL Database system. At some point I was asked to think about possible new storage method that would be optimized for high speed SSD storage. In the end, this project wasn't further pursued as other projects took precedence, but ever since I have had this weird idea of log structured btree storage in my head.

A few years later, when I got more serious about actually implementing this wild distributed file system idea of mine, I needed a suitable key/value store library that could use an append only object store as underlying storage. Unfortunately, none of the existing golang key/value store libraries offered this capability. After some careful thinking I realized that the Log Structured BTree idea, although originally coming from an SSD flash storage context, is in fact perfectly suited for this particular use case. So I started writing a Log Structured BTree key/value store library, LSB.

It took some time, but I got something working. But then, when I started thinking about how exactly I would use it to implement the logical equivalent of the inode table and directories in my file system, I realized I was going to need some kind of transaction support in the library to avoid excessive complexity in the file system code. This meant that I now had to implement some kind of transaction support. That took a bit of time, and when I had it implemented, I found …

more ...

Virtual Router Redundancy Protocol Daemon

I run quite a few computers at home (too many, don't ask). Some of these are servers that I want to have a reliable internet connection, even when I'm not at home for some time. For this reason, I set up two redundant upstream gateway routers, and used ucarp to manage the automatic failover. Ucarp is a portable implementation of CARP (Common Address Redundancy Protocol). At the time, this seemed like a fairly simple and straightforward tool for the job. Unfortunately, after some time I found that it wasn't always 100% reliable, so I started looking for alternatives. I found that the selection was somewhat limited. There were some abandonware tools that hadn't been maintained for a while, some tools that only work in combination with a full Quagga router setup, etc, but nothing that was current, fully functional, and reasonably simple to set up.

So I set about to write my own. I mean, what else would you do?

My goal was to make something that is relatively simple, has relatively few external dependencies, and is preferably portable to other UNIX systems, such at *BSD, even though I develop mostly on Devuan/Debian these days.

The implementation of the core functionality is necessarily kinda tricky, as you are working on raw IP packets, not TCP or UDP, with even a bit of Ethernet MAC frame magic thrown in for good measure, and that automatically gets you into the slightly murkier parts of the socket interfaces on most systems. Still …

more ...