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

Serializable, lockless, distributed: Isolation in CockroachDB

Blog post from Cockroach Labs

Post Details
Company
Date Published
Author
Matt Tracy
Word Count
2,357
Company Posts That Month
5
Language
English
Hacker News Points
-
Post removed?
No
Summary

CockroachDB's architecture ensures serializable isolation in distributed transactions using an optimistic, multi-version, timestamp-ordered concurrency control system. The Serializable Snapshot isolation level guarantees that transactions are recoverable and serializable by enforcing strict scheduling and disallowing any conflicting operations that could create a cyclic serializability graph. CockroachDB achieves this by using a multi-version concurrency control (MVCC) mechanism, where multiple timestamped versions of a key's value are stored, ensuring that write-read conflicts with later transactions are avoided. Additionally, a timestamp cache records read operations to prevent read-write conflicts, while write-write conflicts are managed by aborting transactions that attempt to commit out of order. Transactions are prioritized, with random priorities assigned and adjusted upon restarts to resolve conflicts deterministically. The system also includes mechanisms for dealing with abandoned transactions by using a heartbeat timestamp to identify and abort inactive transactions. CockroachDB's isolation level allows for high concurrency without a central coordinator, offering a robust solution for executing distributed ACID transactions.

Trends Found in this Post

No tracked trend matches for this post yet.

Use This Data

Use this post, company, and trend context to find content marketing opportunities, perform competitive analysis, or address product feature gaps via the Plushcap MCP server or the Plushcap API.