MCPcopy
hub / github.com/cockroachdb/cockroach

github.com/cockroachdb/cockroach @staging-202011251758-v20.2.3 sqlite

repository ↗ · DeepWiki ↗ · release staging-202011251758-v20.2.3 ↗
62,929 symbols 343,268 edges 4,150 files 25,549 documented · 41%
README


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, cockroach-db@googlegroups.com, 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

Extension points exported contracts — how you extend this code

Sender (Interface)
Sender is implemented by modules throughout the crdb stack, on both the "client" and the "server", involved in passing a [49 …
pkg/kv/sender.go
Sink (Interface)
Sink is an abstraction for anything that a changefeed may emit into. [7 implementers]
pkg/ccl/changefeedccl/sink.go
CommandResultErrBase (Interface)
CommandResultErrBase is the subset of CommandResult dealing with setting a query execution error. [6 implementers]
pkg/sql/conn_io.go
State (Interface)
State is opaque state for a Pass. [16 implementers]
pkg/testutils/reduce/reduce.go
CallbackOption (Interface)
CallbackOption is a marker interface that callback options must implement. [8 implementers]
pkg/gossip/gossip.go
SimpleIterator (Interface)
SimpleIterator is an interface for iterating over key/value pairs in an engine. SimpleIterator implementations are threa [9 …
pkg/storage/engine.go
Resumer (Interface)
Resumer is a resumable job, and is associated with a Job object. Jobs can be paused or canceled at any time. Jobs should [11 …
pkg/jobs/registry.go
ModuleTestingKnobs (Interface)
ModuleTestingKnobs is an interface for testing knobs for a submodule. [19 implementers]
pkg/base/testing_knobs.go

Core symbols most depended-on inside this repo

Get
called by 18066
pkg/sqlmigrations/migrations.go
Nulls
called by 11024
pkg/col/coldata/vec.go
Errorf
called by 9976
pkg/util/log/test_log_scope.go
NullAt
called by 8566
pkg/col/coldata/nulls.go
Fatal
called by 7158
pkg/cmd/roachtest/cluster.go
MakeProj4Text
called by 6163
pkg/geo/geoprojbase/geoprojbase.go
Fatalf
called by 4581
pkg/cmd/roachtest/cluster.go
MaybeHasNulls
called by 4009
pkg/col/coldata/vec.go

Shape

Method 37,521
Function 16,229
Struct 6,735
Interface 988
TypeAlias 908
Class 349
FuncType 190
Enum 9

Languages

Go97%
TypeScript3%
Java1%
Python1%

Modules by API surface

pkg/roachpb/api.pb.go2,317 symbols
pkg/server/serverpb/status.pb.go1,432 symbols
pkg/sql/colexec/proj_non_const_ops.eg.go1,188 symbols
pkg/sql/colexec/proj_const_right_ops.eg.go1,186 symbols
pkg/sql/colexec/selection_ops.eg.go1,084 symbols
pkg/server/serverpb/admin.pb.go1,027 symbols
pkg/sql/catalog/descpb/structured.pb.go701 symbols
pkg/roachpb/errors.pb.go686 symbols
pkg/sql/colexec/proj_const_left_ops.eg.go646 symbols
pkg/jobs/jobspb/jobs.pb.go626 symbols
pkg/sql/sem/tree/datum.go494 symbols
pkg/sql/sem/tree/stmt.go422 symbols

Dependencies from manifests, versioned

cloud.google.com/gov0.34.0 · 1×
github.com/Azure/azure-sdk-for-gov33.4.0+incompatible · 1×
github.com/Azure/azure-storage-blob-gov0.0.0-2019010421510 · 1×
github.com/Azure/go-autorest/autorestv0.10.2 · 1×
github.com/Azure/go-autorest/autorest/azure/authv0.4.2 · 1×
github.com/Azure/go-autorest/autorest/tov0.3.0 · 1×
github.com/Azure/go-autorest/autorest/validationv0.2.0 · 1×
github.com/BurntSushi/tomlv0.3.1 · 1×
github.com/DataDog/zstdv1.4.4 · 1×
github.com/MichaelTJones/walkv0.0.0-2016112217533 · 1×
github.com/Shopify/saramav1.22.2-0.2019060411 · 1×

Datastores touched

kvDatabase · 1 repos
tpchDatabase · 1 repos
postgresDatabase · 1 repos
barDatabase · 1 repos
defaultdbDatabase · 1 repos
defaultdb_29Database · 1 repos
fooDatabase · 1 repos
myappdbDatabase · 1 repos

For agents

$ claude mcp add cockroach \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact