YugaByte DB vs CockroachDB

 

Yugabyte DB delivers 4.5x better write throughput at 7x lower latency
on SQL workloads.

Why choose YugaByte DB over CockroachDB?

Comprehensive Distributed SQL

Yugabyte DB is the world’s first cloud native database to support both scale-out RDBMS and internet-scale OLTP in a single system. Developers can choose between a fully relational model and a semi-relational flexible-schema model. CockroachDB only offers a “one size fits all” relational model.

Engineered for Simplicity and Speed

Yugabyte DB is written in C/C++ from top to bottom. CockroachDB uses a mixture of Go for query parsing and the database server, and C++ for storage. Developers know from experience that multi-language software designs can lead to unpredictable behaviors especially when stressed under internet-scale conditions.

Better Performance & Data Density

DocDB, Yugabyte DB’s storage engine, transforms RocksDB from a key-value store (with only primitive data types) to a document store (with complex data types). It is fully optimized for workloads needing fast reads, high volume ingest and high data density. CockroachDB uses RocksDB as a “black-box library” without any optimizations.

Not a Reimplementation of PostgreSQL

Yugabyte DB reuses the native PostgreSQL database server and simply swaps in a strongly consistent, distributed storage layer. CockroachDB has reimplemented the PostgreSQL API in Go. Yugabyte DB supports more features right “out-of-the-box” including, distributed transactions, serializable and snapshot isolation, foreign keys, stored procedures, triggers, sequences and various extensions. Learn more.

Strong Consistency & Global Scale

Both Yugabyte DB and CockroachDB are both Consistent & Partition-tolerant (CP) databases whose sharding, replication and distributed transaction architectures are inspired by Google Spanner.

Unified Transaction Log

Both Yugabyte DB and CockroachDB make use of the Raft consensus protocol to manage data replication and leader election. However, Yugabyte DB’s Raft log acts as a unified transaction log for both the replication and storage engine functions. This design avoids the dual-write performance penalty developers observe in CockroachDB.

Performance Comparison

Features Comparison

FeatureYugabyte DBCockroachDB
Open Source
Horizontal Write Scaling
Self-Healing Fault Tolerance
Consensus-Based Strongly Consistent Replication
Distributed Transactions
Full Spectrum of ACID
Kubernetes-Ready
SQL with JOINs
Semi-Relational with Document & Key-Value
Tunable Read Latency & Read Replicas
Fast, Reliable Distributed Backup
User-Defined Types
Stored Procedures
Partial Indexes
Triggers
High Performance API for Non-Relational Internet-Scale Workloads

Tunable Consistency for High Performance

YugaByte DB supports the ability to configure follower reads to allow high performance apps to read timeline-consistent data from shard followers. This increasing throughput while lowering latency. CockroachDB supports only strongly consistent reads from shard leaders.

Read Replicas for Remote Regions

Raft observer nodes act as read replicas in remote regions thus ensuring low latency reads without adding inter-region latency to the write path. CockroachDB does not support read replicas, thus adding inter-region latency to the write path even when a remote region is read intensive.

Fast Distributed Backups and Restores

YugaByte DB distributed backups are designed to copy data from only the shard leaders using checkpoints without involving any of replicas at any time. CockroachDB requires a logical scan of the table in order to identify a consistent snapshot because it relies on the underlying RocksDB primitives as-is.

4.5x Higher Write Throughput & 7x Lower Latency

Yugabyte DB outperformed CockroachDB 4.5x in terms of write throughput with 7x lower latency on SQL workloads. Yugabyte DB is able to deliver these exceptional performance numbers because of its superior storage engine and replication layer implementation. Learn more.

More PostgreSQL Compatibility “Out-of-the-Box”

Yugabyte DB supports distributed transactions, serializable and snapshot isolation, JOINs, foreign keys and features CockroachDB doesn’t, like User-Defined Types, stored procedures, triggers and partial indexes. Learn more.

Better ROI

Blazing-Fast Business Apps Increase Customer Loyalty

CockroachDB’s higher latency read/write operations mandate the use of a separate caching tier to power low latency customer-facing apps. YugaByte DB’s obviates the need for such a cache and helps increase customer loyalty by serving blazing fast user experiences through native queries.

Smaller Clusters and Agile Operations Lead to Lower TCO

Run ever-growing data workloads alongside distributed transactional workloads on the same cluster with each node handling multiple terabytes of data density. Achieve lowest Total Cost of Ownership through lower infrastructure costs combined with the lower labor cost of managing clusters efficiently with complete automation.

Future-Proofed Operational Data Tier

With its unique ability to power both scale-out RDBMS and internet-scale OLTP workloads, YugaByte DB delivers a more future-proofed operational data tier than compared to the relational-only CockroachDB. Build and run complex microservices faster than ever before.

Download the in-depth write-up that compares architecture, features, performance benchmarks and ROI.