YugaByte DB vs CockroachDB


YugaByte DB delivers an average of 3.5x better throughput and 3x lower latency
across all workloads with support for both scale-out RDBMS and internet-scale OLTP apps.

Why choose YugaByte DB over CockroachDB?

Strong Consistency & Global Scale

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

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.

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.

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.

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.

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
SQL with JOINs
Semi-Relational with Document & KV
Tunable Read Latency & Read Replicas
Fast, Reliable Distributed Backup
High Performance for Internet-Scale Transactional 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.

3.5x Higher Throughput & 3x Lower Latency

Averaged across a wide array of access patterns important to internet-scale transactional workloads, YugaByte DB outperformed CockroachDB 3.5x in terms of throughput and 3x in terms of latency. YugaByte DB is able to deliver these exceptional performance numbers because of its superior storage engine and replication layer implementation.

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.