CockroachDB

Open source

CockroachDB is a cloud-native distributed SQL database built on a strongly consistent key-value store that scales horizontally and survives machine and datacenter failures.

Open-source alternative to

cockroachlabs.com
CockroachDB homepage screenshot
GitHub stars
33k
Last 30 days
+53(+0%)
Last commit
2 days ago
Repository age
12 years
Licence
Custom
Self-hosted
Yes

About CockroachDB

CockroachDB is a distributed SQL database for building, scaling and managing data-intensive modern applications. It is layered on a transactional, strongly consistent key-value store and offers a familiar SQL API for defining, changing and querying data, with ACID transactions across the cluster.

It scales horizontally by adding nodes and is designed to keep running through failed disks, machines, racks and even whole datacenters, with little added latency and no manual recovery. Control over where data is placed is part of the pitch, which matters for locality and compliance. Documentation covers installation, development, deployment and administration, client drivers, and a comparison with other databases, and the design is explained in a public architecture document.

CockroachDB is written in Go. Its license is listed as 'Other' on GitHub, so review the current license terms before using it commercially. You can run your own cluster or let Cockroach Labs run it as the managed CockroachDB Cloud service. It suits teams that need resilient, multi-region relational storage without sharding by hand.

Key features

  • Distributed SQL with ACID transactions
  • Horizontal scaling by adding nodes
  • Survives machine, rack and datacenter failures
  • Control over data placement
  • Built on a strongly consistent key-value store
  • Managed cloud service available

Good fit for

  • Highly available relational databases
  • Multi-region applications with data locality needs
  • Scaling beyond a single SQL server
Built with
Go tools
Tags
distributed-database
sql
database
high-availability
acid
cloud-native
go
scalability

CockroachDB: questions and answers

What is CockroachDB used for?
CockroachDB is a cloud-native distributed SQL database built on a strongly consistent key-value store that scales horizontally and survives machine and datacenter failures. It is a good fit for highly available relational databases, multi-region applications with data locality needs and scaling beyond a single SQL server.
Is CockroachDB open source?
Yes. CockroachDB is open source under a custom licence. Its source code is on GitHub at cockroachdb/cockroach and is written mainly in Go.
Is CockroachDB free?
Yes. CockroachDB is open source, so the software itself is free to use under the terms of its own licence. A managed cloud version is also available.
Can I self-host CockroachDB?
Yes. CockroachDB can be self-hosted on your own server or infrastructure.
What is CockroachDB an alternative to?
CockroachDB is an open-source alternative to Google Cloud Spanner and Amazon Aurora. Other open-source alternatives to Google Cloud Spanner include TiDB, YugabyteDB and OceanBase.
Is CockroachDB actively maintained?
Yes. The most recent commit to CockroachDB was on 11 November 2026. The project has 33k stars on GitHub, with 53 added in the last 30 days.

Open-source alternatives to CockroachDB

See all

SaaS alternatives to CockroachDB

See all