CockroachDB - the open source, cloud-native distributed SQL database.


CockroachDB is a cloud-native SQL database for building global, scalable cloud services that survive disasters.

What is CockroachDB?

CockroachDB is a distributed SQL database built on a transactional and strongly-consistent key-value store. It scales horizontally; survives disk, machine, rack, and even datacenter failures with minimal latency disruption and no manual intervention; supports strongly-consistent ACID transactions; and provides a familiar SQL API for structuring, manipulating, and querying data.

For more details, see our FAQ or architecture document.

Docs

For guidance on installation, development, deployment, and administration, see our User Documentation.

Quickstart

  1. Install CockroachDB.
  2. Start a local cluster and talk to it via the built-in SQL client.
  3. Learn more about CockroachDB SQL.
  4. Use a PostgreSQL-compatible driver or ORM to build an app with CockroachDB.
  5. Explore core features, such as data replication, automatic rebalancing, and fault tolerance and recovery.

Client Drivers

CockroachDB supports the PostgreSQL wire protocol, so you can use any available PostgreSQL client drivers to connect from various languages.

Deployment

  • Test Deployments - Easiest way to test an insecure, multi-node CockroachDB cluster.
  • Production Deployments
    • Manual - Steps to deploy a CockroachDB cluster manually on multiple machines.
    • Cloud - Guides for deploying CockroachDB on various cloud platforms.
    • Orchestration - Guides for running CockroachDB with popular open-source orchestration systems.

Need Help?

Building from source

See our wiki for more details.

Contributing

We welcome your contributions! If you're looking for issues to work on, try looking at the good first issue list. We do our best to tag issues suitable for new external contributors with that label, so it's a great way to find something you can help with!

See our wiki for more details.

Engineering discussion takes place on our public mailing list, [email protected], and feel free to join our Community Slack (there's a dedicated #contributors channel!) to ask questions, discuss your ideas, or connect with other contributors.

Design

For an in-depth discussion of the CockroachDB architecture, see our Architecture Guide. For the original design motivation, see our design doc.

Comparison with Other Databases

To see how key features of CockroachDB stack up against other databases, check out CockroachDB in Comparison.

See Also

Owner
CockroachDB
the scalable, survivable, SQL database
CockroachDB
Comments
  • kvserver: use cached store capcity in more calls

    kvserver: use cached store capcity in more calls

    Is your feature request related to a problem? Please describe.

    store.Capacity() is expensive as it iterates over every replica. It is called periodically on the same interval by different tickers, however we don't use the cached value - meaning that we wastefully recompute it from scratch despite it not being very stale.

    This wastes CPU resources, especially in a high replica count cluster.

    We calculate the store capacity periodically from these places:

    Describe the solution you'd like

    Use Capacity(true /* useCached */) more regularly, rather than have each ticking component which is calling at the same interval calculate from scratch. Ideally, this useCached would switch to a staleness interval the caller is willing to accept the cached value from before recalculating.

    Jira issue: CRDB-23231

  • release-22.2: cli,server: enable `cockroach` on permissionless cwd

    release-22.2: cli,server: enable `cockroach` on permissionless cwd

    Backport 1/1 commits from #94894 on behalf of @knz.

    /cc @cockroachdb/release


    Fixes #28888. Informs zd#15320.

    Prior to this patch, running any cockroach subcommand on a permissionless cwd would fail in two ways:

    • because the computation for the default store path was attempting to access cwd to compute an absolute path.
    • because the GEOS initialization was trying to find the dynamically loadable module relative to cwd.

    This patch changes the former to delay initialization of the configuration until an actual server command is executed; and the latter to tolerate a permissionless cwd.

    Release note (bug fix): It is now possible to run cockroach version and cockroach start (and possibly other sub-commands) when the user running the command does not have permission to access the current working directory.


    Release justification: bug fix to reduce operational friction

  • release-22.1: cli,server: enable `cockroach` on permissionless cwd

    release-22.1: cli,server: enable `cockroach` on permissionless cwd

    Backport 1/1 commits from #94894 on behalf of @knz.

    /cc @cockroachdb/release


    Fixes #28888. Informs zd#15320.

    Prior to this patch, running any cockroach subcommand on a permissionless cwd would fail in two ways:

    • because the computation for the default store path was attempting to access cwd to compute an absolute path.
    • because the GEOS initialization was trying to find the dynamically loadable module relative to cwd.

    This patch changes the former to delay initialization of the configuration until an actual server command is executed; and the latter to tolerate a permissionless cwd.

    Release note (bug fix): It is now possible to run cockroach version and cockroach start (and possibly other sub-commands) when the user running the command does not have permission to access the current working directory.


    Release justification: bug fix to reduce operational friction

  • logictest: unskip mixed version tests for ARM builds

    logictest: unskip mixed version tests for ARM builds

    The arm builds now use the expected tarball name format and can be used in these tests.

    This reverts commit df505daf1419968ed054d30f19f602101ebcb407. Fixes: #94658 Epic: none Release note: None

  • roachtest: add `change-replicas/mixed-version` roachtest

    roachtest: add `change-replicas/mixed-version` roachtest

    Forward-ported from #94888.


    This patch adds a Roachtest which exercises replica config changes in mixed-version clusters. It does so both explicitly with ALTER RANGE RELOCATE and implicitly via zone configs and the replicate queue, in several sequential scenarios:

    1. Mixed pre/main nodes.
    2. All main nodes, unfinalized.
    3. All pre nodes, downgraded from main.
    4. All main nodes, finalized.

    Touches #94834. Epic: none

    Release note: None

TiDB is an open source distributed HTAP database compatible with the MySQL protocol
TiDB is an open source distributed HTAP database compatible with the MySQL protocol

Slack Channel Twitter: @PingCAP Reddit Mailing list: lists.tidb.io For support, please contact PingCAP What is TiDB? TiDB ("Ti" stands for Titanium) i

Jan 9, 2023
"Go SQL DB" is a relational database that supports SQL queries for research purposes

A pure golang SQL database for database theory research

Jan 6, 2023
LBADD: An experimental, distributed SQL database
LBADD: An experimental, distributed SQL database

LBADD Let's build a distributed database. LBADD is an experimental distributed SQL database, written in Go. The goal of this project is to build a dat

Nov 29, 2022
A course to build the SQL layer of a distributed database.

TinySQL TinySQL is a course designed to teach you how to implement a distributed relational database in Go. TinySQL is also the name of the simplifed

Jan 8, 2023
Beerus-DB: a database operation framework, currently only supports Mysql, Use [go-sql-driver/mysql] to do database connection and basic operations

Beerus-DB · Beerus-DB is a database operation framework, currently only supports Mysql, Use [go-sql-driver/mysql] to do database connection and basic

Oct 29, 2022
Couchbase - distributed NoSQL cloud database

couchbase Couchbase is distributed NoSQL cloud database. create Scope CREATE SCO

Feb 16, 2022
An open-source graph database
An open-source graph database

Cayley is an open-source database for Linked Data. It is inspired by the graph database behind Google's Knowledge Graph (formerly Freebase). Documenta

Dec 31, 2022
LinDB is an open-source Time Series Database which provides high performance, high availability and horizontal scalability.
LinDB is an open-source Time Series Database which provides high performance, high availability and horizontal scalability.

LinDB is an open-source Time Series Database which provides high performance, high availability and horizontal scalability. LinDB stores all monitoring data of ELEME Inc, there is 88TB incremental writes per day and 2.7PB total raw data.

Jan 1, 2023
Native, Protobuf & SQL-compliant objects used by offensive security tools.

Attacked Infrastructure Modular Specification (AIMS) Overview This repository aims to gather various declarations/specification of elements faced or n

Nov 19, 2021
Native GraphQL Database with graph backend
Native GraphQL Database with graph backend

The Only Native GraphQL Database With A Graph Backend. Dgraph is a horizontally scalable and distributed GraphQL database with a graph backend. It pro

Jan 4, 2023
A decentralized, trusted, high performance, SQL database with blockchain features
A decentralized, trusted, high performance, SQL database with blockchain features

中文简介 CovenantSQL(CQL) is a Byzantine Fault Tolerant relational database built on SQLite: ServerLess: Free, High Availabile, Auto Sync Database Service

Jan 3, 2023
☄ The golang convenient converter supports Database to Struct, SQL to Struct, and JSON to Struct.
☄ The golang convenient converter supports Database to Struct, SQL to Struct, and JSON to Struct.

Gormat - Cross platform gopher tool The golang convenient converter supports Database to Struct, SQL to Struct, and JSON to Struct. 中文说明 Features Data

Dec 20, 2022
Dolt is a SQL database that you can fork, clone, branch, merge, push and pull just like a git repository.

Dolt is a SQL database that you can fork, clone, branch, merge, push and pull just like a git repository. Connect to Dolt just like any MySQL database to run queries or update the data using SQL commands. Use the command line interface to import CSV files, commit your changes, push them to a remote, or merge your teammate's changes.

Dec 31, 2022
DonutDB: A SQL database implemented on DynamoDB and SQLite

DonutDB: A SQL database implemented on DynamoDB and SQLite

Dec 21, 2022
This is a simple Golang application that executes SQL commands to clean up a mirror node's database.

This is a simple Golang application that executes SQL commands to clean up a mirror node's database.

Jan 24, 2022
Distributed reliable key-value store for the most critical data of a distributed system

etcd Note: The master branch may be in an unstable or even broken state during development. Please use releases instead of the master branch in order

Jan 9, 2023
The lightweight, distributed relational database built on SQLite.
The lightweight, distributed relational database built on SQLite.

rqlite is a lightweight, distributed relational database, which uses SQLite as its storage engine. Forming a cluster is very straightforward, it grace

Jan 5, 2023
TalariaDB is a distributed, highly available, and low latency time-series database for Presto
TalariaDB is a distributed, highly available, and low latency time-series database for Presto

TalariaDB is a distributed, highly available, and low latency time-series database that stores real-time data. It's built on top of Badger DB.

Nov 16, 2022
Redwood is a highly-configurable, distributed, realtime database that manages a state tree shared among many peers

Redwood is a highly-configurable, distributed, realtime database that manages a state tree shared among many peers. Imagine something like a Redux store, but distributed across all users of an application, that offers offline editing and is resilient to poor connectivity.

Jan 8, 2023