ramblings

go, js, and other stories

Read this first

Relational DBs on Key-Value Stores

Over the last several years, we’ve seen the rise of fast, ordered, transactional key-value stores such as leveldb, rocksdb, and lmdb. These are all very cool projects in their own rights, but perhaps even more notable are the projects built on top of them, such as MyRocks, SQLite4, CockroachDB, and Google’s F1.

To better understand how these work, I’ve been hacking together a basic relational database on a key-value store named voodoo. Interestingly, many of the concepts are applicable to everyday usage of a normal SQL database, especially in understanding query plans and indexes.

Starting from the Beginning

A relational database is centered around the concept of a table, which is comprised of rows and columns. Notably, all tables have a column labeled as a primary key, which is used to uniquely identify each row. In the example users table below, id is the primary key.

id userna ...

Continue reading →


Go Dependencies Considered Harmful

In the wake of the ongoing vendoring discussions within the Go community, I think that almost all Go projects should be able rely on having few, mature, dependencies, regular builds (almost all CI systems support some sort of cron for regular builds), and good test coverage to ensure they stay on top of their third-party dependencies.

Mature third party libraries don’t change their API hugely, and suddenly. Libraries such as github.com/lib/pq and github.com/gorilla/mux that are cornerstones of many large Go projects simply don’t become different libraries with completely different APIs overnight.

Using immature and unstable libraries is a mistake no matter how you look at it - if the library is still under development or not well maintained (i.e. breaks API compatibility every other week), why are you using it for a production application? It’s entirely the developer’s responsibility...

Continue reading →