CockroachDB — Postgres for the cloud

Mohammed Zaheeruddin Malick
2 min readFeb 16, 2022

I wonder why CockroachDB is not picking up steam, It’s written by the three of the most prolific engineers on the planet: Spencer Kimball, Peter Mattis, and Ben Darnell.

I am a big fan of Kimball and Mattis as they gave the world, for free and open source, The GTK framework which led to the Gnome project — The foundation of Linux GUI; Using GTK they developed GIMP (poor-man’s photoshop, but not poor in functionality). Later these genius engineers worked on Google Spanner and since google is not open sourcing the same (I hope they will one day), they started developing an open source variant of Spanner but named it CockroachDB! Woink Woink!!

The name may not be very marketing-friendly, but the meaning sure is — Cockroach is one organism which can potentially survive a man-made (nuclear) or act-of-god (some asteroid the likes of which killed the dinosaurs) armageddon, heck roaches can even eat radio-active dust and adapt, nerdy to name a database for its resiliency just like the cockroach!

The DB is super cool though, it is built natively for the cloud, works seamlessly with Kubernetes, installs easily with helm and has an hybrid architecture, as-in, the underlying persistence engine is a distributed key-value store with highly fault tolerant automatic-replication and sharding of the key-space powered by the gossip protocol (smart! they kicked zookeeper to the curb!!), yet the query layer is Postgres wire compatible SQL, by doing this they brought the best of both words together in one package!

You can use ORM the likes of Hibernate/SqlAlchemy or if you hate ORM-generated SQL then perhaps JDBI or even plain old JDBC works with no issues and full syntax compatibility with PostGres (and yes, it works perfectly fine with table plus) and they very smartly chose Go lang for developing the database, which perhaps made it much easier to port/adapt PostGres wire protocol from C source code, and thanks to go lang, it comes with automatic garbage collection for free (Go lang ~ C with Garbage Collection) how cool is that!

Furthermore, it comes with an admin interface which servers on port 8080, with all the info about cluster and Keyspace metrics, and even has features for query debugging, all built-in!!

I am in awe as to how well they have thought out each and every aspect of engineering the new database, starting with the programming language, to automatic resiliency, to seamless scalability, to marrying the best of both worlds — sql and no-sql, to the tenet of being cloud native, to the admin interface, to the postgres compatibility and amazing documentation, just nailed it!! Pure Genius!!

I am still a big fan of Postgres, its legendary but CockroachDB (crdb) is a true evolution of the legend!

God bless the smart engineers who solve internet scale problems for fun in their garage, and give it away for free!

Don’t mess with the geeks

--

--

Mohammed Zaheeruddin Malick

Tireless Learner | Geek | Father of two budding Women leaders!