3 ms·
GPS is "just" each satellite sending out a constant readout of its current time, very precisely. By reading these from several satellites it's possible to figur
by InclinedPlane 9y ago
GPS is "just" each satellite sending out a constant readout of its current time, very precisely. By reading these from several satellites it's possible to figure out what the actual current time is and then from that determine the time of flight of each signal. Which gives you the distance to each satellite, so if you know where each satellite is you can figure out your own position too.
The point is, it's time based, and it enables synchronization of clocks across the globe to sub-microsecond accuracy. Google uses that feature for keeping its distributed databases synchronized as well. It's not just an alternative to NTP, it's a way to keep systems in sync to a very, very precise degree. Which requires constant communication with time reference servers. They don't put a GPS receiver in every server, just a redundant cluster of them in each data center.
Consider a transactional write using Spanner, the way it works is that the system connects to all of the relevant database shards, it knows what all of their clock accuracy levels are and so it knows how long it needs to wait to negotiate a transaction lock. This is only possible due to the high accuracy of time synchronization. Meanwhile it's buffering write data/instructions to all the hosts. Once it gets the lock it then sends out commit instructions. The whole process can take mere tens of milliseconds for a handful of hosts and only a few hundreds of milliseconds for hundreds of hosts. Which is remarkable when you consider the scale of the problem.
- erentz 9y ago> They don't put a GPS receiver in every server, just a redundant cluster of them in each data center. Ok that’s what I figured. The way the media reported on this the use of GPS as a time source was the special big deal. And I was trying to work out why because there was nothing novel in putting GPS time sources in data centers. (We did that at my first job not quite 2 decades ago...)