Sitemap

Making Cockroaches Fly High

3 min readMay 24, 2016

--

TL;DR: Where I kick the tires of CockroachDB on DC/OS. It’s awesome.

A couple of days ago, Peter Mattis of Cockroach Labs gave a super-exciting talk about CockroachDB at our Mesosphere HQ in San Francisco. I was immediately hooked and wanted to kick the tires of CockroachDB on DC/OS. Now, I’m a big fan of the SQL-on-non-relational-DB combo. I’ve started to contribute to the Apache Drill project back in 2012 and over the time realized how powerful it is to combine a SQL (== what every BI tool, every DBA and their dog speaks) front-end with a non-relational DB (== auto-sharding, scaleable, cloud-native) back-end.

While Drill—which is really an open source version of Google’s Dremel and you might’ve heard about the public-facing offering BigQuery as well?—takes a generic approach (aka: bring your own back-end), in CockroachDB they’re using, at its core, a key-value store called RocksDB (which in turn leverages LevelDB). Sounds complicated? Forget about it, you won’t notice it as an end-user; it’s really just an implementation detail that makes the whole thing: 1. scaleable, and 2. fast.

Back to CockroachDB on DC/OS: I started out with the Docker image provided and while I initially experienced a little hurdle, it was resolved (thanks to everyone involved, including the awesome Cockroach Labs team and my colleagues Jess & John for helping me to get rid of this issue!) and now I can launch and use CockroachDB on DC/OS :)

Ah, how, you ask? OK, here we go:

Zoom image will be displayed
A DC/OS cluster as the starting point.

I ramped up a DC/OS cluster and launched CockroachDB using the following Marathon app spec:

Marathon app spec I used to launch CockroachDB on DC/OS.

This results in:

Zoom image will be displayed
DC/OS dashboard view of CockroachDB.
Zoom image will be displayed
Viewing the stderr output of CockroachDB on DC/OS.
Marathon UI view of CockroachDB.

Since I’ve placed CockroachDB onto the public agent and using above (first) port 12503 I can now access the Admin UI that Marathon has mapped from the container-internal port 8080:

Zoom image will be displayed
CockroachDB Admin UI on my public DC/OS agent.

Next, I wanted to test the data ingestion and querying, so I would use, from within the DC/OS cluster the internal CockroachDB SQL client; first, we create the database bank and the user maxroach (using the root account):

CockroachDB: set up database and user using the internal SQL client.

Now we log in as user maxroach, create a table, insert some data as well as perform some queries:

As a last step, I checked the Admin UI again to verify if everything worked out as expected:

Zoom image will be displayed
CockroachDB Admin UI, database view.

This concluded my first experience with CockroachDB, an awesome open source NoSQL database that allows you to do SQL like a hero.

I hope you got a bit of an idea how easy and powerful CockroachDB is and I plan to use CockroachDB in upcoming demos as well.

KUTGW, good folks at Cockroach Labs and excited to see what’s coming down the pipe next.

Those guys really roach, erm, rock!

--

--

Michael Hausenblas
Michael Hausenblas

Written by Michael Hausenblas

open-source observability @ AWS | opinions -: own | 塞翁失马

Responses (1)