Home / Companies / Cockroach Labs / Blog / Post Details
Content Deep Dive

CockroachDB's Consistency Model

Blog post from Cockroach Labs

Post Details
Company
Date Published
Author
Andrei Matei
Word Count
6,922
Language
English
Hacker News Points
119
Summary

CockroachDB is an open-source, distributed SQL database that provides a sophisticated consistency model, which exceeds standard serializability but falls short of strict serializability, while ensuring no stale reads in transactions. The database employs multi-version concurrency control (MVCC) to manage transaction isolation and guarantees that once a write transaction is committed, all subsequent read transactions will see it, thereby preventing stale reads. CockroachDB's implementation involves a transaction layer that assigns timestamps to ensure correct transaction ordering, even across unsynchronized nodes. Although it allows a rare anomaly known as "causal reverse," where concurrent transactions might appear out of order, this is mitigated by ensuring overlapping read/write sets are properly synchronized. CockroachDB effectively balances high consistency with performance and resilience, making it a compelling choice for distributed systems despite not offering full strict serializability.