๐Ÿชณ

CockroachDB

CockroachDB is a distributed SQL database designed to survive entire data-center outages without losing data, maintained by Cockroach Labs. It sits around #28 in real-world usage (roughly 1%, tied with PocketBase) โ€” it speaks a Postgres-compatible wire protocol while automatically replicating data across regions.

๐Ÿ“Œ Quick facts
Type: Distributed relational (SQL, "NewSQL")
Made by: Cockroach Labs
License: Free/open-source core, with paid managed cloud
Hosting: Self-hosted or cloud-managed
Primary use case: Mission-critical applications needing built-in multi-region disaster resilience

Core concepts & example

CockroachDB uses standard SQL and the Postgres wire protocol, so most Postgres clients and drivers work unchanged:

CREATE TABLE accounts (
  id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
  balance DECIMAL NOT NULL
);

SELECT id, balance FROM accounts WHERE balance > 1000;

Getting started

CockroachDB runs as a standalone binary or cluster, easiest to try locally as a single node:

# start a single-node local cluster
cockroach start-single-node --insecure --listen-addr=localhost:26257
๐ŸŽฏ Best for: mission-critical applications that need SQL with built-in multi-region disaster resilience.