Skip to content

CockroachDB

Summary

CockroachDB is a distributed SQL database from Cockroach Labs. It offers serializable ACID transactions, automatic sharding into Raft-replicated ranges, and multi-region survivability, all behind a PostgreSQL-compatible wire protocol. The current Regular release is v26.2 (GA 2026-04-27) and the newest Innovation release is v26.3 (2026-08). Since v24.3 (2024-11-18), it ships under the proprietary CockroachDB Software License. The free "Core" edition is gone. Self-hosted clusters need an Enterprise, Enterprise Free (companies under $10M revenue) or Trial license key.

Overview

CockroachDB stores all data in one sorted key-value space, split into ranges of up to 512 MiB. Each range is replicated, by default three times, through its own Raft group. Any node can accept SQL. The gateway plans the query and routes key-value requests to each range's leaseholder, which since v25.2 is always the Raft leader (leader leases). The cluster rebalances and re-replicates automatically, so it survives disk, node, zone and, when configured, whole-region failures without manual failover.

Key Facts

Attribute Detail
Website cockroachlabs.com
Latest Version v26.2.6 Regular (2026-08-21). v26.3.0 Innovation (support start 2026-08-19)
Release cadence Quarterly major versions, alternating Regular (12 + 6 months support, LTS extension) and Innovation (6 months, skippable)
License CockroachDB Software License (proprietary, source-available) since v24.3, 2024-11-18. Previously BSL 1.1 core plus CCL enterprise
Free use Enterprise Free for businesses under $10M annual revenue (telemetry required, annual renewal). Single-node dev clusters need no key
Language Go (storage engine: Pebble)
Company Cockroach Labs
Wire Protocol PostgreSQL-compatible (pgwire, port 26257)
Default isolation SERIALIZABLE. READ COMMITTED GA since v24.1
Managed offering CockroachDB Cloud: Basic, Standard, Advanced plans

Evaluation

Pros Cons
Survives zone and region failures automatically Proprietary license since v24.3. No longer open source. Larger companies must pay
PostgreSQL wire protocol, drivers and most ORMs work Higher per-operation latency than single-node PostgreSQL (Raft quorum on every write)
Serializable by default. READ COMMITTED available No PostgreSQL extensions. Some catalog and DDL gaps
Horizontal scaling, automatic splitting and rebalancing Innovation-release churn. Regular releases must not be skipped
Declarative multi-region (REGIONAL BY ROW, GLOBAL tables) Enterprise Free and Trial clusters are throttled without telemetry
Built-in vector indexes (GA v25.4), CDC, PCR, LDR Higher infrastructure cost (3-node minimum) and specialized skills
Online schema changes, built-in backup to cloud storage Managed Cloud pricing can be high at scale

When It Fits

  • Systems of record that must stay up through zone or region outages: payments, identity, inventory, ledgers.
  • Multi-region apps with data-residency needs (pin rows to a region).
  • Teams that want PostgreSQL semantics but have outgrown a single primary's write capacity.

When It Does Not

  • Single-region apps that fit comfortably on one PostgreSQL primary with a replica: PostgreSQL is cheaper, faster per query, and fully open source.
  • Workloads that depend on PostgreSQL extensions (PostGIS as an extension, TimescaleDB, pg_cron).
  • Organizations that require an OSI-approved license.

The flowchart below is a quick fit check. The comparison page has a fuller decision matrix.

flowchart TD
    Q1{"Must the database survive a<br/>zone or region outage automatically?"}
    Q2{"Do writes outgrow one primary,<br/>or must data stay in specific regions?"}
    Q3{"Is a proprietary license with<br/>paid tiers acceptable?"}
    PG["PostgreSQL + HA tooling<br/>(Patroni, managed RDS/Cloud SQL)"]
    OSS["Look at Apache-2.0 distributed SQL<br/>(YugabyteDB, TiDB)"]
    CRDB["CockroachDB<br/>(self-hosted Regular release or Cloud)"]

    Q1 -->|"No"| Q2
    Q1 -->|"Yes"| Q3
    Q2 -->|"No"| PG
    Q2 -->|"Yes"| Q3
    Q3 -->|"Yes"| CRDB
    Q3 -->|"No"| OSS

Architecture

Every node runs the full stack (SQL, transactions, distribution, Raft replication, Pebble storage). The compact view below shows a client connecting to any gateway node, which routes key-value requests to the leaseholders of the ranges it needs. Each range is a Raft group spread across three nodes. Details are in Explanation.

flowchart LR
    App["App (PostgreSQL driver)"] --> LB["Load balancer<br/>(port 26257)"]
    subgraph Cluster["CockroachDB cluster"]
        subgraph N1["Node 1"]
            SQL1["SQL gateway + DistSender"]
            P1["Pebble store"]
        end
        subgraph N2["Node 2"]
            SQL2["SQL gateway + DistSender"]
            P2["Pebble store"]
        end
        subgraph N3["Node 3"]
            SQL3["SQL gateway + DistSender"]
            P3["Pebble store"]
        end
    end
    LB --> SQL1
    LB --> SQL2
    LB --> SQL3
    SQL1 -->|"KV batch to leaseholder of range R7"| P2
    P2 <-->|"Raft group R7"| P1
    P2 <-->|"Raft group R7"| P3

    style Cluster fill:#6933ff,color:#fff

Key Features

Feature Detail Since
Raft consensus per range Strong consistency. Leader leases remove the node-liveness single point of failure Leader leases default v25.2
Range-based sharding Automatic split and merge (512 MiB max, 128 MiB min by default) plus load-based splitting Core design
Multi-region SQL Survival goals, REGIONAL BY ROW, GLOBAL tables, super regions v21.1+
Isolation levels SERIALIZABLE default, READ COMMITTED RC GA v24.1
PostgreSQL features PL/pgSQL, stored procedures, triggers, row-level security v23.2 / triggers GA v26.2 / RLS v25.2
Vector search pgvector-compatible VECTOR type and CREATE VECTOR INDEX (hierarchical k-means ANN) Type v24.2, index preview v25.2, GA v25.4
CDC Changefeeds to Kafka, cloud storage, webhooks, Google Pub/Sub Long-standing
Replication between clusters Physical cluster replication (failover DR), logical data replication (active-active) PCR GA v24.1, LDR GA v25.2
Online schema changes Non-blocking DDL on live tables. Hash-sharded indexes for sequential keys Long-standing
Security mTLS, SCRAM, JWT/OIDC/LDAP/GSSAPI, encryption at rest, audit logs, post-quantum TLS (preview v26.2), FIPS 140-3 readiness (preview v26.1) Various
Observability DB Console, Prometheus endpoint, Insights, Active Session History (preview v26.2) Various

Full version-by-version availability is in Reference: Feature Availability by Version.

Licensing & Pricing

Option Summary
Enterprise (paid) All features, Enterprise or Essential support. Annual contract
Enterprise Free All features, free for organizations under $10M total annual revenue. Telemetry mandatory, renew annually, community support only
Enterprise Trial 30 days, telemetry mandatory
No key Only cockroach start-single-node / cockroach demo. Multi-node clusters are throttled to 5 concurrent transactions 7 days after init
CockroachDB Cloud Basic, Standard, Advanced. Licensed automatically. Basic: $0.20 per 1M Request Units and $0.50 per GiB of storage, with the first $15 of usage free each month on monthly billing. Standard: per provisioned vCPU-hour by cloud and region. Advanced: per node-hour by machine size, cloud and region (Basic pricing, Understand costs, checked 2026-09-28)

License change (2024-11-18)

CockroachDB Core (BSL 1.1, free for any size company) was retired with v24.3. Patch releases of v23.1 to v24.2 published after that date also moved to the CockroachDB Software License. Upgrading an old Core cluster to such a patch starts a 30-day grace period before throttling. See Reference: License Tiers and Explanation: Licensing Model History.

Releases & Versions

Series Type Support ends (maintenance / assistance)
v26.3 Innovation 2027-02-19 (EOL)
v26.2 Regular 2027-04-27 / 2027-10-27
v25.4 Regular, LTS 2027-05-03 / 2028-05-03
v25.2 Regular, LTS 2026-12-17 / 2027-12-17
v24.3 Regular, LTS ended / 2027-05-05

The recommended upgrade path is Regular to Regular (for example v25.4 -> v26.2), skipping Innovation releases unless you need their features. The full matrix is in Reference, and the upgrade steps are in How-to Guides.

Alternatives

Alternative Positioning
PostgreSQL Single-primary, fully open source. The default unless you need distributed writes or automatic regional failover
MySQL Single-primary. Group Replication for HA
YugabyteDB PostgreSQL-compatible distributed SQL (reuses PostgreSQL's query layer), Apache 2.0
TiDB MySQL-compatible distributed SQL, Apache 2.0
Google Cloud Spanner / Amazon Aurora DSQL Fully managed distributed SQL tied to one cloud

Migration from PostgreSQL uses Cockroach Labs' MOLT tools (schema conversion, MOLT Fetch, MOLT Replicator). Lock-in risks include the proprietary license, CockroachDB-specific multi-region DDL, and crdb_internal tooling.

Topic Map

  • How-to Guides: install, secure, license, multi-region, backup, CDC, vector search, upgrade, troubleshooting, Commands & Recipes.
  • Reference: release and support matrix, license tiers, feature availability, zone-config and cluster-setting defaults, vector parameters, security matrix, benchmarks.
  • Explanation: layer model, transactions (Parallel Commits), leader leases, Pebble, write path, multi-region patterns, vector index internals, licensing and release model, security model.

Sources

Questions

Open

  • What exactly ships in v26.3? On 2026-09-28 the docs repo lists v26.3.0 (2026-07-27) and v26.3.1, but its v26.3 feature-highlight pages were still placeholders.
  • When will v26.2 receive its LTS designation? v25.2 and v25.4 got LTS about 7 and 6 months after GA.
  • How does the vector index's recall and latency compare with pgvector HNSW on the same dataset? There is no independent benchmark yet.

Answered

  • Q: Can I use PG drivers? Yes. CockroachDB uses the PostgreSQL wire protocol, so psql, pgx, JDBC, and most ORMs work.
  • Q: Is CockroachDB still free to self-host? Only for single-node development clusters, or through the Enterprise Free license (under $10M revenue, telemetry required). Core was retired on 2024-11-18.
  • Q: Is it serializable-only? No. SERIALIZABLE is the default, and READ COMMITTED is GA since v24.1.
  • Q: Does it have a vector index? Yes. CREATE VECTOR INDEX has been GA since v25.4 (preview in v25.2). The VECTOR type arrived in v24.2.
  • Q: Is the multi-metric allocator on by default in v26.3? Yes, after upgrade finalization: kv.allocator.load_based_rebalancing defaults to auto, which resolves to multi-metric and count once the cluster version reaches v26.3 (kvserverbase/base.go, checked 2026-09-28).
  • Q: What does CockroachDB Cloud cost? Basic is $0.20 per 1M Request Units plus $0.50 per GiB of storage, with $15 of usage free each month on monthly billing. Standard is billed per provisioned vCPU-hour and Advanced per node-hour, both by cloud and region. See Reference: CockroachDB Cloud for the documented examples.