---
title: "Living without atomic clocks: Where CockroachDB and Spanner diverge"
description: "CockroachDB borrows Spanner's TrueTime-inspired approach to ordering distributed transactions but replaces atomic-clock-bounded certainty with a looser uncertainty interval and uncertainty restarts."
url: "https://swe.quest/articles/living-without-atomic-clocks-where-cockroachdb-and-spanner-diverge-d4e6d0cdd53bad94"
canonical: "https://www.cockroachlabs.com/blog/living-without-atomic-clocks/"
source: "Cockroach Labs"
published: "2022-01-27"
difficulty: "hard"
kind: "Deep dive"
reading_minutes: 10
tags: ["consistency","time-clocks","distributed-databases","distributed-systems"]
---

# Living without atomic clocks: Where CockroachDB and Spanner diverge

A post on [Cockroach Labs](https://swe.quest/sources/cockroachdb.md), published 2022-01-27, 10 min read, Deep dive. Original: [https://www.cockroachlabs.com/blog/living-without-atomic-clocks/](https://www.cockroachlabs.com/blog/living-without-atomic-clocks/)

## Summary

CockroachDB borrows Spanner's TrueTime-inspired approach to ordering distributed transactions but replaces atomic-clock-bounded certainty with a looser uncertainty interval and uncertainty restarts. Spanner waits out a tight TrueTime bound (about 7 ms) after writes to guarantee linearizability, while CockroachDB assigns provisional timestamps from local wall clocks and retries reads that hit keys within the clock-offset uncertainty interval, providing serializability rather than linearizability. The tradeoff is occasional read restarts—bounded by the configured maximum clock offset, up to roughly 250 ms with NTP—instead of delaying every write; CockroachDB also uses causality tokens to preserve ordering across causally related transactions. Nodes that exceed the maximum configured clock offset self-terminate.

Written by swe.quest, not by the author.

**Difficulty:** Hard: written for specialists in the field

## Topics

- [Consistency models](https://swe.quest/tags/consistency.md) (Distributed systems)
- [Time & clocks](https://swe.quest/tags/time-clocks.md) (Distributed systems)
- [Distributed databases](https://swe.quest/tags/distributed-databases.md) (Data & databases)
- [Distributed systems](https://swe.quest/tags/distributed-systems.md) (Distributed systems)

## Prerequisites

- Distributed systems basics ([easy posts on Distributed systems](https://swe.quest/tags/distributed-systems.md?difficulty=easy))
- Consistency models such as serializability and linearization ([easy posts on Consistency models](https://swe.quest/tags/consistency.md?difficulty=easy))
- Clock synchronization and NTP ([easy posts on Time & clocks](https://swe.quest/tags/time-clocks.md?difficulty=easy))

## Keywords

CockroachDB, Spanner, TrueTime, NTP, Percolator, Calvin, SLOG

## Related posts

- [Orbital Computing and Distributed Databases | CockroachDB](https://swe.quest/articles/orbital-computing-and-distributed-databases-cockroachdb-c5f1cf8d95fd646c.md): Cockroach Labs · 2026-08-06 · Medium · 18 min read · Distributed databases, Consensus, Replication, Distributed systems, Performance engineering
  Orbital compute creates a harder problem for stateful systems than for GPUs: data must be replicated, coordinated and placed across a moving constellation.
- [RAMP-TAO: Layering atomic transactions on Facebook’s online graph store](https://swe.quest/articles/ramp-tao-layering-atomic-transactions-on-facebook-s-online-graph-store-470552a388260a08.md): Meta Engineering · 2021-08-18 · Hard · 2 min read · Consistency models, Distributed databases, Caching, Distributed systems
  RAMP-TAO is a protocol that layers read-atomic transactional guarantees on top of TAO, Facebook's eventually consistent social graph store, so developers get an intuitive read transaction API without handling fractured-read anomalies.
- [CockroachDB Redefines Database Performance with Real-World Testing](https://swe.quest/articles/cockroachdb-redefines-database-performance-with-real-world-testing-c9cd765cf1dfea56.md): Cockroach Labs · 2025-05-29 · Hard · 5 min read · Distributed databases, Performance engineering, Resilience, Databases, Chaos engineering
  Cockroach Labs argues that traditional benchmarks like TPC-C, designed in 1992, measure peak throughput in pristine lab conditions and end the test once a power pull disrupts steady state, so they say nothing about behavior during failures, maintenance or recovery.
- [Evolving our real-time timeseries storage again: Built in Rust for performance at scale](https://swe.quest/articles/evolving-our-real-time-timeseries-storage-again-built-in-rust-for-performance-cbd41a18b9630cd7.md): Datadog Engineering · 2025-08-04 · Hard · 21 min read · Storage engines, Rust, Performance engineering, Databases, Concurrency
  Datadog's sixth-generation real-time timeseries database (RTDB) is a Rust rewrite that unifies two earlier engines, one for scalar metrics and one for DDSketch distributions, after earlier generations built on Cassandra, Redis, MDBM, a Go B+ tree and RocksDB.
- [Deno KV internals: building a database for the modern web](https://swe.quest/articles/deno-kv-internals-building-a-database-for-the-modern-web-61dddae321d95df6.md): Deno · 2023-09-14 · Hard · 10 min read · Distributed databases, Consistency models, Storage engines, JavaScript
  Deno KV's production backend runs on FoundationDB, with a custom "transaction layer" in front of it that handles multi-tenant configuration, JavaScript-native types such as bigint sums, and cross-region replication.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
