Living Without Atomic Clocks

Living Without Atomic Clocks” is an interesting article that covers some design bits of distributed systems and CockroachDB (what a name!), especially those related to time precision.  This part in particular is the one I’m sure I’ll came back to at some point:

How does TrueTime provide linearizability?

OK, back to Spanner and TrueTime. It’s important to keep in mind that TrueTime does not guarantee perfectly synchronized clocks. Rather, TrueTime gives an upper bound for clock offsets between nodes in a cluster. Synchronization hardware helps minimize the upper bound. In Spanner’s case, Google mentions an upper bound of 7ms. That’s pretty tight; by contrast, using NTP for clock synchronization is likely to give somewhere between 100ms and 250ms.

So how does Spanner use TrueTime to provide linearizability given that there are still inaccuracies between clocks? It’s actually surprisingly simple. It waits. Before a node is allowed to report that a transaction has committed, it must wait 7ms. Because all clocks in the system are within 7ms of each other, waiting 7ms means that no subsequent transaction may commit at an earlier timestamp, even if the earlier transaction was committed on a node with a clock which was fast by the maximum 7ms. Pretty clever.

what3words – addressing the world

what3words is an interesting solution to the problem of the global addresses.  What’s the problem, you ask?  Well, according to their website:

  • Poor addressing costs businesses billions of dollars and hampers the growth and development of entire nations.
  • Around 75% of the world (135+ countries) suffers from inadequate addressing.
  • 4 billion people are invisible, unable to get deliveries or receive aid, and unable to exercise their rights as citizens.

That doesn’t sound too far from the truth.  So, how do they solve it?

what3words_converter

what3words is a global grid of 57 trillion 3mx3m squares.

Each square has a 3 word address that can be communicated quickly, easily and with no ambiguity.

Our geocoder turns geographic coordinates into these 3 word addresses and vice-versa.

Using words means non-technical people can accurately find any location and communicate it more quickly, more easily and with less ambiguity than any other system like street addresses, postcodes, latitude & longitude or mobile short-links.

It’s a very elegant solution.  Obviously, it doesn’t solve all of the problems (for example, it does not take height into account, so if you have a 50-floor high apartment block, all 50 floors will share the same squares).  But this solution is still valuable and super easy to use.

And it’s fun too!  I live around crowbar.land.premises, and I work close to simply.approve.pretty.  See, I told you.

By the way, what3words has been recently in the news:

Mongol Post, the country’s largest mail provider, has licensed the system from What3Words, and starting in September it will offer customers the option of using the three-word codes. (The company added Mongolian to its first 10 languages; 14 more are coming.)

If that’s not cool, I don’t know what is.

Why Waze is so incredibly popular in Costa Rica

Why Waze is so incredibly popular in Costa Rica – excellent story, which, I think, is pretty applicable in Cyprus too.  There aren’t many people here.  And there are even fewer sensible street addresses.  We are landmark driven navigation country too.

waze

EU supports eCall – GPS in every car

Slashdot reports:

the European Parliament has pass a resolution in support of eCall, an initiative to install devices in vehicles that automatically contact emergency services in the event of a crash. The resolution calls on the European Condition to make it mandatory for all new cars starting in 2015.

Sounds good, doesn’t it?  But just think about it for a second.  There you go, driving your car around.  And all of a sudden – BOOM – crash!  Not to worry.  Your car has a device installed that dials the emergency services and there is a digital conversation similar to this:

– Hello, this is emergency services.  How can I help you?
– Hello, this is Mitsubishi Galant GDI.  Registration number XYZ123.  I’ve just crashed and need assistance.
– OK, please remain calm.  The help is on the way.  Whereabouts are you now?
– My map suggests that I am Pentadromos, Limassol, Cyprus.  My GPS coordinates are 34.680635, 33.043198.
– We’ve got you.  There is a unit nearby.  It should be at your location in approximately 2 minutes.
– Thank you. Bye.

This sounds so good, for when you really need help.  But there is another side to it – vehicle tracking.  How comfortable are you with someone else knowing where you went, how fast you went there, and for how long you stayed there?  And we aren’t talking just about the authorities here.  Think of all those hackers, script kiddies, private investigators, and then authorities.

Now, back to the original application – emergency services.  It obviously comes at a price of your privacy.  Is that too much to pay?

Some problems never get old. Or do they?

A couple of years ago I went through all our (Olga’s and mine) printed photographes, selected the good ones, and ordered scans from the studio, so that I could have them all in digital form. One of the annoying problems I came across when catalogueing those images was the date.

Most images didn’t have any date reference what-so-ever, so I had to guess when it was or date these images as very uproximate. Others, did have a date added by the camera. The problem though, was that in many cases, the date was way off. That’s because the camera was never properly configured (users hate manuals).

Today, while importing images to Flickr I realized that the same problem applies to digital cameras too. Many images in my gallery had a really wrong timestamp in the EXIF data. Useless. Good thing I was keeping them in the directory structure, which referenced the date (2005/2005-04-15_My_birthday). I could easily fix it with a tiny script.

This got me thinking. How can the problem be solved once and for all? Is it even possible? Is there a way for digital camera to know what time it is, without user telling it? How about people who travel a lot – do they have to reconfigure their cameras at every time zone?

The travelling bit gave me an idea – GPS. Some cameras already use GPS to add geolocation coordinates to the meta data of the picture. But GPS receivers can be also used for maintaining the precise clock, which can be autoconfigured, and autoconfigured with time zone of the actual camera location. This is sweet!

Hopefully Canon (and other vendors who I don’t care about) already does it, or plans to do it in the nearest future. That could be an excellent technology application – useful, and invisible to the user. Just as it should be.