Get to know How Golang is used at CockroachDB

Reemi Shirsath
3 min readJul 30, 2020

--

Before starting with how Golang is helping CockroachDB, let us quickly understand what is CockrochDB

What is CockroachDB?

A distributed SQL database with strong and consistent ACID properties in transactions, familiar and simple SQL API with amazing survivability, horizontal scalability. CockroachBD is an open-source database.

Golang’s Role at CockroachDB

To some who have experience using CockroachDB, they might know it is a distributed database, and writing distributed databases in Golang might sound a little risky. Golang has a garbage collection feature and garbage collection of JVM as most of us know that is quite expensive

There are only a few languages to choose while developing a high performance distributed system/application. And in the list of C++, Java, Golang outranks rest. Java faces some challenges in the performance aspect and C++ require large efforts for creating our own libraries and deals with a complication for writing distributes database task.

Golang being a relatively new language for many of the developers working on the project but the inbuilt support for libraries, testing, interfaces, and tooling in the Golang made it possible to position itself as the right choice for CockroachDB. Golang being relatively new never caused the reason for any barrier in contribution toward CockroachDB. Golang is simple is comparatively simple to learn for developers with C++ or Java experience.

As of now, CockroachDB has 18.5 K stars rating, 2.2k forks, and 321 contributors to the project. CockroachDB has used Golang 95.4%. Code complexity management undoubtedly has a great impact after the language we choose and plays a major role in Open source.

Golang was created to develop a highly scalable application/system with keeping into consideration of its unique feature and simplicity. Golang help in simple and automated import management, the minimal set of programmatic idioms, high performance, inbuilt standard libraries, and the code which is clean and understandable. Quantifying the productivity achieves by Golang over C++, Java is difficult.

While comparing Golang with C++, Golang offers the possibility of doing something in more than one way, automated management for memory. CockrachDB has also made use of Channels for synchronization.

While comparing Golang to Java, the Specific focus on implementation is given other than that on Object-oriented programming (OOP) and abstraction. The flexibility of adding interface as per the requirement.

CockroachDB has migrated its large system from Java to Golang and which has helped them with garbage collection overhead and decrease in the memory footprint

Get to know more about CockroachDB here

You can also read more articles about Golang here-

How a Company Reduced its number of Server from 30 to 2 Using Golang

Get to Know How Golang is contributing to Bitly

Things You Need to Know About Golang For Web Development

Here Is Why Golang Is One Of The Preferred Technology For Your Project

Some Interesting Facts and Takeaways from Golang Survey

--

--

Reemi Shirsath
Reemi Shirsath

Written by Reemi Shirsath

𝘾𝙊𝙊 @ 𝙂𝙤𝙡𝙖𝙣𝙜 𝙎𝙥𝙚𝙘𝙞𝙖𝙡𝙞𝙨𝙚𝙙 𝘿𝙚𝙫𝙚𝙡𝙤𝙥𝙢𝙚𝙣𝙩 𝘾𝙤𝙢𝙥𝙖𝙣𝙮- Scalent.io

No responses yet