« All posts

There Is No "Now" in Distributed Systems

Inspired by Einstein's relativity: NTP clock sync is an illusion. Learn how logical clocks, CAP theorem, and TrueTime solve event ordering in distributed systems.

This piece draws a direct line from Einstein's special relativity — the idea that there is no universal 'now' — to distributed systems engineering. NTP-synchronized clocks are typically only within 1-100 milliseconds of each other, which invalidates the common assumption that a smaller timestamp means an earlier event. This flawed assumption quietly breaks distributed locks, event-sourcing replay, log correlation, and cache invalidation in production systems.

The fix is Lamport's 1978 logical clocks and their extension, vector clocks, which track causality rather than wall-clock time. Systems like DynamoDB, Riak, and CRDTs rely on this approach to resolve conflicting writes. The CAP theorem is reframed as a physical constraint: during a network partition, you must choose between consistency and availability — there's no third option, just as there's no faster-than-light shortcut in physics.

For cases where real wall-clock time is unavoidable, like financial transactions or audit logs, the article points to Google's TrueTime API in Spanner, which returns a bounded uncertainty interval instead of a single timestamp. The practical takeaway: use logical clocks for causal ordering, match consistency guarantees to the specific data's needs, and always treat timestamps as ranges rather than exact points.

This synthesis was produced from its source by AI; there is no human editor or manual review step. How we work