CockroachDB

OLTP

CockroachDB (sometimes shortened as CRDB) is a free and open source distributed SQL database built on a transactional and strongly-consistent key-value store. It is backed by PebbleDB (a RocksDB/LevelDB-inspired KV store) and uses the Raft distributed consensus algorithm to ensure consistency.

Fault Tolerance

Quorum-based Replication

Foreign Keys

Supported

CockroachDB supports foreign keys.

Joins

Nested Loop Join Hash Join Sort-Merge Join Shuffle Join Semi Join Index Nested Loop Join

CockroachDB supports all standard SQL joins. Distributed joins are performed via a shuffle by hash strategy, or a batched nested loop strategy. Broadcast joins are not supported.

Query Compilation

Code Generation

CockroachDB implements a MonetDB/X100 style vectorized execution engine, which compiles queries into a tree of monomorphized query execution operators.

Query Execution

Tuple-at-a-Time Model Vectorized Model

CockroachDB supports distributed SQL execution. The gateway query node is responsible for creating a DAG of SQL processors and distributing them across the cluster, like in F1. The individual SQL processors operate in either a tuple-at-a-time mode, which supports all SQL queries in CockroachDB, or a vectorized mode, which supports a subset of SQL, depending on query cardinality.

Query Interface

SQL

CockroachDB aims to provide compatible PostgreSQL with extensions, but some standard SQL functionality is under development.

Storage Architecture

Disk-oriented

The backend storage in CockroachDB is Pebble, a native Go version of RocksDB. It is disk-oriented storage.

Storage Model

Custom

CockroachDB stores its data in the distributed key-value store.

Storage Organization

Log-structured

Stored Procedures

Supported

System Architecture

Shared-Nothing

CockroachDB has two layers, the SQL layer and the storage layer. The SQL layer sits on top of the transactional and strongly-consistent distributed key-value store. In the key-value store, the key ranges are divided and stored in RocksDB and replicated across cluster. It exports structured data API of relational concepts. It exports standard SQL interface at the SQL layer. The SQL layer translates SQL statements into calls to structured data API.

User-Defined Functions

PL/SQL

CockroachDB implements SQL and PL/PGSQL user-defined functions.

Embeddings

People Also Viewed

CockroachDB Logo
Website

https://www.cockroachlabs.com/

Source Code

https://github.com/cockroachdb/cockroach/

Tech Docs

https://www.cockroachlabs.com/docs/stable/

Twitter

@CockroachDB

Developer

Cockroach Labs

Country of Origin

US

Start Year

2014

Project Type

Commercial, Open Source

Written in

Go

Supported languages

Go

Derived From

RocksDB

Embeds / Uses

Pebble

Inspired By

Cloud Spanner

Compatible With

PostgreSQL

Operating Systems

Linux, OS X, Windows

Licenses

Business Source License

Wikipedia

https://en.wikipedia.org/wiki/Cockroach_Labs

Embeddings

People Also Viewed