CockroachDB Test Drive

We do a lot at Mi4. We create turnkey applications, custom software solutions, provide BI and data visualization consulting, software integrations, cloud migrations, cloud to on-premise connectivity, and a bunch of other stuff that is slipping my mind right now. We also write fascinating and insightful blogs.

Because we offer so many IT solutions we keep a pulse on what’s going on in the IT world around us. We stay abreast of updates, changes, and new feature options that are available on the platforms we currently use, but we also keep an eye out for new products and techniques that could benefit our customers.

I came across one of these products called CockroachDB while naviguant sur Internet (French for “doing market research”). CockroachDB is a cloud-native SQL Database; a new breed of solution that is a consistently-replicated, transactional datastore by default. Now the name “CockroachDB” makes more sense doesn’t it?

I’ll admit that while I am familiar with the concepts of NoSQL, NewSQL and globally distributed cloud databases, I myself have more experience with the traditional SQL Database engines that run on on-premise servers (Oracle, Microsoft SQL Server, MySQL, etc). We have other team members more well versed in cloud technologies and I’ve worked with them on projects where we migrated clients’ on-premise data to cloud databases and that was pretty straightforward. There are some limitations to server-less cloud databases but you get other benefits.

Back to the topic of this post, I wanted to take CockroachDB for a test drive and see how easy it is for someone more familiar with traditional tools to spin up a cloud database and migrate one of our demo databases to it. Truth be told, recently I’ve been vraiment occupé (French for really busy) and while I have wanted to do this for weeks, I haven’t really had the time. So I figured I would make my busy schedule part of the test drive process. Could a competent database developer (ok, reasonably competent database developer) get CockroachDB up and running in 2 hours? Let’s find out…..

Getting Started

To start, I went straight to the horse’s mouth to find out how to install what I needed on my machine. They recommend Linux or MacOs over Windows, so I spun up my Debian VM. From there I followed the installation and quick start guide.

I was super impressed with how easy it was to install and get the database services up and running. CockroachDB’s website and guide made this a breeze. This is even more impressive because you are setting up multiple nodes, replication, load balancing, etc. This was one the easiest standups of a multiple node database I’ve seen.

Granted, I was implementing the easiest development architecture where all nodes were on my one VM and I was running them without SSH for testing purposes BUT I was ready to start creating (or migrating in my case) a database within 15 minutes from my first Linux command to download the software. Top-notch stuff.

Database Deployment

It looked like I was well on my way to having the demo database up and running in my CockroachDB development environment and I could get back to my billable work for Hakamada Resources. But my high speed joy ride on the autobahn encountered a traffic jam…ok more like a Sunday driver going 40 in a 75. It was a language barrier.

CockroachDB is a close cousin to Postgres and I was migrating a Microsoft SQL Server database. There is a difference in the SQL syntax between PostgreSQL and Transact-SQL that made generating a CREATE SQL script a nonviable solution. A database conversion is possible but not within my 2 hour time limit. If Mr. Hakamada was paying for this test-drive, I would have totally done it. But this was more of a proof-of-concept than an actual project and I know I could have the database in CockroachDB so I left it at that and moved on.

The language barrier and database conversion are not deal-breakers but the next thing I found could be. CockroachDB does not support stored procedures. If you are considering moving an existing database solution to CockroachDB this could be a road block that is tough to get around. It might still be worth it, but the time and cost of moving your stored procedure logic out of the database and into your micro-services or applications might be intensive.

Knowing I would not migrate an entire database or any stored procedures, I went ahead and manually created a database and a table. Once again, this was very easy the CockroachDB documentation is great. From there, I launched their web-based control panel to see how my implementation was going.

Navigating the control panel was intuitive and it was easy to see what was going on in my little environment. You can also use Linux terminals to connect to each node and run commands.

Parting Thoughts

That was about it for my test-drive. I got started in well under 2 hours and probably could have had a full database deployed – but translating SQL didn’t sound as fun as checking out more of what CockroachDB could do.

One of the main tag lines for CockroachDB is “invest in data resilience, not disaster recovery.” This is the strength of CockroachDB. By default it is high-availability, load balanced, and highly scalable. These are tricks the old dogs had to learn a decade ago and did so with great growing pains. CockroachDB makes that part easy. But that doesn’t mean CockroachDB is right for you. Every scenario and application is different. If you’re thinking about creating a cloud application or migrating to the cloud, drop us a line, and we can see which platform works best for your requirements.

Privacy Policy Made with in Texas.