# How clock drift and network latency affect distributed database writes, and how Spanner uses TrueTime

DevFeed: [How clock drift and network latency affect distributed database writes, and how Spanner uses TrueTime](<https://devfeed.tech/articles/clock-synchronization-is-a-nightmare-why-spanner-uses-truetime-and-the-rest-of-us-suffer-39579.md>)

Original publisher: [Read original article](<https://ankit-rana.com/logs/27-clock-synchronization-truetime/>)

Author: hello@ankit-rana.com

Published: 2026-05-17T00:00:00Z

Content type: article

Language: en

Sources: [Ankit Rana | Mechanical Sympathy](<https://devfeed.tech/sources/ankit-rana-mechanical-sympathy.md>)

Topics: [distributed-systems](<https://devfeed.tech/topics/distributed-systems.md>), [Databases](<https://devfeed.tech/topics/databases.md>), [Network](<https://devfeed.tech/topics/network.md>), [Latency](<https://devfeed.tech/topics/latency.md>), [Hardware](<https://devfeed.tech/topics/hardware.md>), [Google](<https://devfeed.tech/topics/google.md>)

Tags: [clocks](<https://devfeed.tech/tags/clocks.md>), [consistency](<https://devfeed.tech/tags/consistency.md>), [data](<https://devfeed.tech/tags/data.md>), [databases](<https://devfeed.tech/tags/databases.md>), [distributed-systems](<https://devfeed.tech/tags/distributed-systems.md>), [google](<https://devfeed.tech/tags/google.md>), [gps](<https://devfeed.tech/tags/gps.md>), [hardware](<https://devfeed.tech/tags/hardware.md>), [latency](<https://devfeed.tech/tags/latency.md>), [network](<https://devfeed.tech/tags/network.md>), [ntp](<https://devfeed.tech/tags/ntp.md>), [spanner](<https://devfeed.tech/tags/spanner.md>), [synchronization](<https://devfeed.tech/tags/synchronization.md>), [truetime](<https://devfeed.tech/tags/truetime.md>)

## AI overview

The article explains how quartz-clock drift and variable network latency limit NTP synchronization across servers. It describes how clock skew can cause last-write-wins conflict resolution to silently discard a newer database write, and presents Google Spanner's use of GPS, atomic clocks, and TrueTime uncertainty intervals as a mitigation.

## Source excerpt

Server clocks come from quartz crystals that drift with temperature, and NTP cannot fully correct them because you cannot measure absolute time over a variable-latency network. Under last-write-wins, a node whose clock runs 10 ms fast can silently discard a newer write from a node that is behind: no error, normal logs, lost user data. Spanner solves it with GPS and atomic clocks, where TrueTime returns an uncertainty interval and the commit waits it out.