Form3

Engineering · Blogs

.tech Podcast - Running CockroachDB

Join host Kevin Holditch for a podcast episode on running CockroachDB. Daniel Holt from Cockroach Labs takes us through the different options and which would fit you best.

January 24, 20225 min read

There are three ways of running CockroachDB: self-hosted, CockroachDB Cloud and CockroachDB serverless.
Daniel Holt discusses the pros and cons of each on the .tech podcast hosted by Form3’s Kevin Holditch.

Daniel goes through some common use cases and how CockroachDB can help you implement them.
Here are some key highlights of this episode.

Ep 23 .tech - Running Cockroach DB

Listen on Form3’s .tech podcast.

LISTEN TO EPISODE

Introduction to CockroachDB

The elevator pitch of CockroachDB is that it is a horizontally scalable, relational database.

CockroachDB bridges the gap between the existing database offerings. It gives you a SQL database that is Postgres dialect compatible, ACID compliance and horizontally scalability by adding more nodes. It can also be run in any public and private cloud provider, or any hardware.

CockroachDB provides serialializable isolation, which protects from all data anomalies.

In a cluster, nodes use RAFT based consensus. Nodes must agree on the value of the data before it is written, offering immediate consistency. This is especially important for industries like Form3, where we deal with payments data which must be absolutely consistent.

CockroachDB presents itself as a normal relational database with a SQL API, but under the bonnet it splits up the data into key-value stores and moves them across nodes. It uses forked version of RocksDB, which is a consistent key value store, and then allocates the data across the cluster nodes. This makes it easy to add and remove nodes from the CockroachDB cluster.

  • Data is split in 512 MiB data ranges. Nearly every operation is done at the range level.
  • Each range has a replication factor of 3. One of the replicated ranges gets elected as a leaseholder and it controls all the reads and writes on that data range. This allows Cockroach to scale the operations on the range level.

Running CockroachDB

There are a few different ways to run CockroachDB:

  1. Self-hosted allows you to deploy the cluster yourself by downloading the binary or Kubernetes using a Docker image.
    undefinedundefinedundefined
  2. CockroachDB Cloud is a PaaS offering for CockroachDB, which is proving popular with a lot of small to medium size customers.
    undefinedundefinedundefinedundefined
  3. CockroachDB Serverless is the newest offering. It is a consumption based model for CockroachDB.
    undefinedundefinedundefined

Written by

Adelina Simion

Adelina Simion

Technology Evangelist

Adelina is a polyglot engineer and developer relations professional, with a decade of technical experience at multiple startups in London. She started her career as a Java backend engineer, converted later to Go, and then transitioned to a full-time developer relations role. She has published multiple online courses about Go on the LinkedIn Learning platform, helping thousands of developers up-skill with Go. She has a passion for public speaking, having presented on cloud architectures at major European conferences. Adelina holds an MSc. Mathematical Modelling and Computing degree.