CockroachDB replaces proprietary distributed databases like Cloud Spanner with a self-hosted, PostgreSQL-compatible engine built for high availability.
Former Google engineers Spencer Kimball, Peter Mattis, and Ben Darnell founded CockroachDB in 2015 to replicate Google Spanner's distributed architecture without proprietary atomic clocks. They engineered a distributed SQL database that splits tables into ranges replicated across independent nodes using Raft consensus. Today, it gives engineering teams a PostgreSQL-compatible query interface that survives hardware failures and executes serializable transactions across commodity infrastructure.
Deploying self-hosted CockroachDB lets DevOps engineers integrate database operations directly into internal infrastructure, GitOps pipelines, and Kubernetes clusters via the official operator. CockroachDB Dedicated delegates node provisioning, patching, and networking to Cockroach Labs within managed cloud accounts. For organizations facing data sovereignty mandates, air-gapped policies, or local regulations, self-hosting keeps storage, traffic, and encryption keys within private perimeters.
The primary trade-off centers on operational burden versus infrastructure control. CockroachDB Dedicated automates scaling, patching, and backups, removing cluster management from product teams. Running the self-hosted engine shifts disk provisioning, certificate rotation, and clock drift monitoring to internal platform teams. In exchange, organizations avoid managed markups, eliminate vendor lock-in, and can deploy clusters across bare-metal servers or private data centers.
CockroachDB vs CockroachDB Dedicated — which deployment model should a team choose? CockroachDB Dedicated fits teams wanting Cockroach Labs to manage cloud infrastructure, patches, and automated backups on AWS or Google Cloud. Self-hosted CockroachDB is better for teams operating private Kubernetes clusters or requiring absolute data governance.
Is self-hosted CockroachDB free for production use? CockroachDB source code uses the BSL-1.0 license, allowing free internal production use for organizations below specific revenue and cluster scale thresholds defined by Cockroach Labs. Larger enterprises or companies offering database hosting services require a commercial license.
Can CockroachDB serve as a drop-in replacement for PostgreSQL? It connects via standard PostgreSQL drivers and supports typical SQL schemas, but it lacks support for native extensions, triggers, or procedural languages. Applications also must handle distributed transaction retries.
CockroachDB is an exceptional database for engineering teams requiring multi-master distributed SQL and continuous cluster availability, provided application services can tolerate distributed transaction retries and slightly higher single-key latency. Active development with frequent GitHub commits ensures regular engine refinements and expanding PostgreSQL compatibility, while its BSL-1.0 license permits internal enterprise deployments but restricts unauthorized commercial hosting. For organizations seeking distributed resilience on private infrastructure without cloud lock-in, it provides an established foundation.
Free IDE for Java, Kotlin, Go, TypeScript and Python. Built on IntelliJ Community, fully open source, 300+ plugins.
Show that CockroachDB is listed as an open-source alternative. Paste into your README: