Live data from Hacker News

Living Without Atomic Clocks

cockroachlabs.com

31–40 of 52 posts

Re: Living Without Atomic Clocks

#31

First, CockroachDB's time api is based on the Hybrid Logical Clocks paper: http://www.cse.buffalo.edu/tech-reports/2014-04.pdf This paper is one of the most interesting published in the last couple of years IMO. I remain surprised at how many people have overlooked it. I'm not sure why this blog post makes no mention of the work, in the past the Cockroach folks have been quite explicit about crediting the research do…

That's a pending patent application, not (yet, anyway) an actual patent.

Re: Living Without Atomic Clocks

#32
post #21
post #4

Earlier quoted context omitted.

Something I never understood. If velocity (?) affects time, wouldn't time operate a different speed at different parts of the universe / solar system?

Absolute velocity does not affect time, simply because there is no such thing as absolute velocity. Relative velocity, though, does. For instance, if you look at a clock on a GPS satellite, moving fast relative to you, you can see it run slower than the one on your wrist. Similarly, someone stationary on the surface of the sun would see us here on earth moving in slow motion. However, someone moving on the satellite…

> For instance, if you look at a clock on a GPS satellite, moving fast relative to you, you can see it run slower than the one on your wrist.

Actually, the general relativity effects of weaker gravitational field dominate the special relativity effects of velocity[1]. So the GPS satellite clock actually runs faster, not slower.

[1] http://www.astronomy.ohio-state.edu/~pogge/Ast162/Unit5/gps....

Re: Living Without Atomic Clocks

#33

I don't understand why 7ms is considered a good bound for atomic clocks? Hafele and Keating Experiment: "During October, 1971, four cesium atomic beam clocks were flown on regularly scheduled commercial jet flights around the world twice, once eastward and once westward, to test Einstein's theory of relativity with macroscopic clocks. From the actual flight paths of each trip, the theory predicted that the flying clo…

In this context, 7ms refers to the size of the TrueTime uncertainty interval, which is different from the typical instantaneous clock error. TrueTime returns an interval that is guaranteed to contain the absolute idealized physical "now." So this interval represents a worst case boundary, and if a system using TrueTime is able to separate events by the current interval, for example by forcing a committer to wait it out, then it can provide a temporal order that reflects the absolute real world physical order, despite any clock uncertainty. It's a bit different to think about than how we typically work with time, but it's a powerful primitive in a globally distributed system.

Re: Living Without Atomic Clocks

#34

Nice writeup. I disagree that we need chip-scale, atomic clocks. My idea was a dedicated, battery-backed piece of hardware that reliably stored time plus could sync other machines. Plugs into an interconnect with ultra-low latency. One for each datacenter. You can plug them into each machine in the cluster periodically to sync them. Or you can plug it into a master node that connects with low-latency management inter…

> My idea was a dedicated, battery-backed piece of hardware that reliably stored time plus could sync other machines. Plugs into an interconnect with ultra-low latency. One for each datacenter. Google have a variant on this, where they use a GPS receiver in each data centre to provide an accurate time source for local machines.

It's actually a mix of GPS and atomic clocks for diversity. See the Spanner paper section on TrueTime for details

Re: Living Without Atomic Clocks

#35
post #21

Earlier quoted context omitted.

Absolute velocity does not affect time, simply because there is no such thing as absolute velocity. Relative velocity, though, does. For instance, if you look at a clock on a GPS satellite, moving fast relative to you, you can see it run slower than the one on your wrist. Similarly, someone stationary on the surface of the sun would see us here on earth moving in slow motion. However, someone moving on the satellite…

> For instance, if you look at a clock on a GPS satellite, moving fast relative to you, you can see it run slower than the one on your wrist. Actually, the general relativity effects of weaker gravitational field dominate the special relativity effects of velocity[1]. So the GPS satellite clock actually runs faster, not slower. [1] http://www.astronomy.ohio-state.edu/~pogge/Ast162/Unit5/gps....

There's a really neat thing about this, the relationship balances out at a certain orbital height, before it flips over so there's an orbit where your chronologically in synch with the ground.

Re: Living Without Atomic Clocks

#36

Earlier quoted context omitted.

> For instance, if you look at a clock on a GPS satellite, moving fast relative to you, you can see it run slower than the one on your wrist. Actually, the general relativity effects of weaker gravitational field dominate the special relativity effects of velocity[1]. So the GPS satellite clock actually runs faster, not slower. [1] http://www.astronomy.ohio-state.edu/~pogge/Ast162/Unit5/gps....

There's a really neat thing about this, the relationship balances out at a certain orbital height, before it flips over so there's an orbit where your chronologically in synch with the ground.

Hadn't thought about it that way, but you are right.

Re: Living Without Atomic Clocks

#37
When executing a transaction with a given timestamp on some node, doesn't the node have to guarantee that it will no longer accept commits with a smaller timestamp? Without that commitment, you could read a piece of data that is later updated by a transaction that occurred logically before you, breaking serializablility and/or snapshot isolation.

The spanner paper is unclear how they deal with this, but my guess is that since they have accurately synchronized clocks, you'll never have to block long for that commitment to hold. Spanner also uses pessimistic locking, so for a R/W transaction, you can rely on locking reads to prevent the anomaly.

With cockroachdb, wouldn't this commitment imply that poorly synchronized clocks would lead to poor performance?

Re: Living Without Atomic Clocks

#38
post #27

First, CockroachDB's time api is based on the Hybrid Logical Clocks paper: http://www.cse.buffalo.edu/tech-reports/2014-04.pdf This paper is one of the most interesting published in the last couple of years IMO. I remain surprised at how many people have overlooked it. I'm not sure why this blog post makes no mention of the work, in the past the Cockroach folks have been quite explicit about crediting the research do…

Kudu uses a similar algorithm which we call HybridTime. You can read the tech report here: http://pdsl.ece.utexas.edu/david/hybrid-time-tech-report-01.... and the source here: https://github.com/apache/incubator-kudu/blob/master/src/kud... Both are probably more readable than patent-ese :)

I know I'm diping my toe in some history here, but is there a sense of how the patent situation is going to shake out? I think this general family of algorithm is very important.

Re: Living Without Atomic Clocks

#39

Nice writeup. I disagree that we need chip-scale, atomic clocks. My idea was a dedicated, battery-backed piece of hardware that reliably stored time plus could sync other machines. Plugs into an interconnect with ultra-low latency. One for each datacenter. You can plug them into each machine in the cluster periodically to sync them. Or you can plug it into a master node that connects with low-latency management inter…

That's already a thing, Google GPS based NTP servers with a TCXO or Rubidium reference. You can buy one for ~2000$ that will use GPS, or Cellular as a time reference, and can add options like a Temperature controlled crystal oscillator (TCXO), or a Rubidium reference (basically, small atomic reference).

Re: Living Without Atomic Clocks

#40

Nice writeup. I disagree that we need chip-scale, atomic clocks. My idea was a dedicated, battery-backed piece of hardware that reliably stored time plus could sync other machines. Plugs into an interconnect with ultra-low latency. One for each datacenter. You can plug them into each machine in the cluster periodically to sync them. Or you can plug it into a master node that connects with low-latency management inter…

That's already a thing, Google GPS based NTP servers with a TCXO or Rubidium reference. You can buy one for ~2000$ that will use GPS, or Cellular as a time reference, and can add options like a Temperature controlled crystal oscillator (TCXO), or a Rubidium reference (basically, small atomic reference).

Interesting. So, are you saying it's a start on my idea or what I'm proposing? As in, can it currently sync the servers in multiple datacenters to the point they could operate with microsecond spreads?
Post reply on HN