YugabyteDB vs CockroachDB

YugabyteDB is 100% open source distributed PostgreSQL for modern global applications. CockroachDB isn’t.
Amazon Aurora
YugabyteDB and CockroachDB are both distributed transactional databases (also known as distributed SQL databases). This page walks you through the main differences between these two databases.
TLDR;

YugabyteDB is the better choice for you if:

  • You’re on PostgreSQL and are struggling with scale or resilience
  • Your global applications need multi-region databases for data residency, resilience, or low latency access
  • You’re modernizing your legacy Oracle, DB2, or SQL Server databases to a cloud native database
  • You want to use a 100% open source database that doesn’t tie you down with a proprietary software license.
Switch to YugabyteDB

What are the differences between YugabyteDB and CockroachDB?

YugabyteDB can scale reads and writes horizontally without limits

1. YugabyteDB is the most PostgreSQL-compatible distributed database

YugabyteDB offers superior PostgreSQL compatibility by reusing PostgreSQL’s query layer code. This approach allows YugabyteDB to retain all the power and familiarity of PostgreSQL, pairing its trusted API with a precision-engineered, distributed, cloud native architecture. Essentially, YugabyteDB is distributed PostgreSQL for modern cloud native applications.

Developers using YugabyteDB benefit from the full range of familiar PostgreSQL features they are used to — such as stored procedures, triggers, and native read committed isolation levels — as well as the extensions and tools they love. They can start quickly with a familiar API.

In contrast, CockroachDB is rewriting the query layer from scratch and implementing PostgreSQL features piecemeal. As a result, it lacks key PostgreSQL features that developers expect and doesn’t behave as developers expect from a PostgreSQL-compatible database. This also makes migrations from PostgreSQL to CockroachDB more challenging.

You can geo-partition YugabyteDB clusters for compliance and low latency

2. YugabyteDB has built-in replication for flexible multi-region deployments


Global applications need multi-region databases for ultra-resilience, data residency, and low-latency access across different geographies. With YugabyteDB, you can design and deploy the ideal architecture for your global application.

YugabyteDB offers a wider range of multi-region blueprints using built-in synchronous and asynchronous replication, allowing you to achieve the optimal balance of latency, resilience, and consistency. These include globally-consistent multi-region clusters, read replicas, xCluster asynchronous replication for disaster recovery, two-data-center configurations, row-level geo-partitioning, and more.

YugabyteDB makes migrations simpler

3. YugabyteDB makes migrations simpler

Database migrations are notoriously painful and error prone, often resulting in delays and downtime. But, with the right tool, they can be more manageable, maybe even pain free. YugabyteDB Voyager offers a unified solution to simplify the migration of both schema and data to YugabyteDB from a wide range of legacy and single-cloud databases—including live migration from Oracle. Built-in fail-forward capabilities also minimize migration risks. We are committed to simplifying the full migration lifecycle for enterprises with large portfolios of databases.

CockroachDB offers a schema conversion toolkit, but relies on AWS Data Migration Service (DMS) for data loading, limiting the source or target to AWS.

YugabyteDB is 100% open source with no feature gating

4. YugabyteDB is 100% open source with no feature gating

YugabyteDB is fully open source and freely available to all under the Apache 2.0 license. Moreover, YugabyteDB has all the advanced features that enterprises need, such as multi-region deployments, backups, disaster recovery, data encryption, and more.

While other database vendors are going back on their commitment to open source by changing their licensing model, we choose to remain 100% open source. Our commercial product, YugabyteDB Aeon, is a database-as-a-service that simplifies the deployment and operation of YugabyteDB at scale.

In contrast, Cockroach Labs changed the license for CockroachDB Core from Apache 2.0 to the more restrictive Business Source License several years ago. Recently, Cockroach eliminated its free-to-use Core offering, forcing all organizations with revenue over $10M to pay for the expensive CockroachDB Enterprise license. Without a free Core plan to fall back on, customers are locked in even if their relationship with Cockroach sours.

Learn how our open source software compares with YugabyteDB Aeon in the Compare Deployment Options page.

You can run relational and semi-relational workloads on YugabyteDB

5. You can run relational and semi-relational workloads on YugabyteDB

YugabyteDB offers a fully-relational API that is runtime compatible with PostgreSQL as well as a flexible-schema semi-relational API with roots in Apache Cassandra query language (CQL) best suited for internet-scale OLTP apps. This API flexibility allows you to run a wide range of applications on YugabyteDB.

CockroachDB on the other hand has only a relational API, which is wire-compatible with PostgreSQL.

YugabyteDB Supports More Widely Used SQL Features

Better native PostgreSQL compatibility means greater productivity from day one.

Feature CockroachDB YugabyteDB
PostgreSQL Runtime Compatibility
Built-In Connection Pooling
Bi-Modal Query Execution
User-Defined Functions (UDFs)
Stored Procedures (SQL, pl-pgsql)
Cursors
Triggers
Row-Level Security
Column-Level Locking
xCluster Asynchronous Replication
Foreign Data Wrappers
Common table expressions

FAQ

How does YugabyteDB compare to PostgreSQL?

YugabyteDB re-uses the upper half of PostgreSQL allowing us to offer advanced features and provide a seamless transition to distributed SQL. Below the API layer, Yugabyte has completely re architected a distributed, transactional storage layer to seamless handle spreading the database across numerous nodes. Think of YugabyteDB as PostgreSQL for the cloud native world.

How can I deploy YugabyteDB?

YugabyteDB offers a range of deployment options to suit diverse infrastructure needs and preferences. You can deploy it as a fully managed DBaaS on your preferred cloud platform (AWS, Azure, or Google Cloud). You can also deploy it as a self-managed DBaaS on public clouds, on-premises, or in a hybrid setup. Additionally, YugabyteDB can be installed on VMs, containers, or bare-metal systems.

Is YugabyteDB really open source?

Yes, like PostgreSQL, the YugabyteDB database is 100% open source under the Apache 2.0 license and is available for download on Github. Our commercial DBaaS solutions include support and a powerful control plane for easy deployment and scalable management.

If you have any further questions, please don’t hesitate to contact our team
Contact Us