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

Living Without Atomic Clocks | Where CockroachDB & Spanner Diverge

Blog post from Cockroach Labs

Post Details
Company
Date Published
Author
Spencer Kimball
Word Count
2,269
Company Posts That Month
11
Language
English
Hacker News Points
94
Post removed?
No
Summary

In exploring the differences between Google's Spanner and CockroachDB, the emphasis lies on how these distributed databases handle time synchronization to ensure consistency. Spanner leverages atomic and GPS clocks to maintain precise time synchronization across nodes using its "TrueTime" API, which helps achieve linearizability by bounding clock offsets tightly, allowing efficient ordering of transactions. CockroachDB, inspired by Spanner, aims to achieve similar consistency without specialized hardware. Instead, it supports serializability and uses a provisional commit timestamp approach with retries to address timing uncertainties caused by clock offsets. While Spanner waits for a short interval to ensure transaction ordering, CockroachDB sometimes retries reads when encountering uncertain timestamps, which can lead to multiple read attempts but maintains the integrity of transaction ordering. The document highlights the complexity of achieving clock synchronization in distributed systems and the innovative solutions each database employs to address these challenges, noting that while Spanner provides stronger consistency guarantees, CockroachDB is designed to operate on commodity hardware with broader cloud compatibility.

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.