{"id":27511,"date":"2017-04-10T09:40:25","date_gmt":"2017-04-10T07:40:25","guid":{"rendered":"https:\/\/mamchenkov.net\/wordpress\/?p=27511"},"modified":"2017-04-10T09:40:25","modified_gmt":"2017-04-10T07:40:25","slug":"living-without-atomic-clocks","status":"publish","type":"post","link":"https:\/\/mamchenkov.net\/wordpress\/2017\/04\/10\/living-without-atomic-clocks\/","title":{"rendered":"Living Without Atomic Clocks"},"content":{"rendered":"<!-- google_ad_section_start -->\n<p>&#8220;<a href=\"https:\/\/www.cockroachlabs.com\/blog\/living-without-atomic-clocks\/\">Living Without Atomic Clocks<\/a>&#8221; is an interesting article that covers some design bits of distributed systems and <a href=\"https:\/\/github.com\/cockroachdb\/cockroach\">CockroachDB<\/a> (what a name!), especially those related to time precision. \u00a0This part in particular is the one I&#8217;m sure I&#8217;ll came back to at some point:<\/p>\n<blockquote><p><b>How does TrueTime provide linearizability?<\/b><\/p>\n<p>OK, back to Spanner and TrueTime. It\u2019s 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\u2019s case, Google mentions an upper bound of <em>7ms<\/em>. That\u2019s pretty tight; by contrast, using <a href=\"https:\/\/en.wikipedia.org\/wiki\/Network_Time_Protocol\" target=\"_blank\">NTP<\/a>\u00a0for clock synchronization is likely to give somewhere between <em>100ms<\/em> and <em>250ms<\/em>.<\/p>\n<p>So how does Spanner use TrueTime to provide linearizability given that there are still inaccuracies between clocks? It\u2019s actually surprisingly simple. It waits. Before a node is allowed to report that a transaction has committed, it must wait <em>7ms<\/em>. Because all clocks in the system are within <em>7ms<\/em> of each other, waiting <em>7ms<\/em> 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 <em>7ms<\/em>. Pretty clever.<\/p><\/blockquote>\n<!-- google_ad_section_end -->\n","protected":false},"excerpt":{"rendered":"<!-- google_ad_section_start -->\n<p>&#8220;Living Without Atomic Clocks&#8221; is an interesting article that covers some design bits of distributed systems and CockroachDB (what a name!), especially those related to time precision. \u00a0This part in particular is the one I&#8217;m sure I&#8217;ll came back to at some point: How does TrueTime provide linearizability? OK, back to Spanner and TrueTime. It\u2019s &hellip; <a href=\"https:\/\/mamchenkov.net\/wordpress\/2017\/04\/10\/living-without-atomic-clocks\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Living Without Atomic Clocks<\/span><\/a><\/p>\n<!-- google_ad_section_end -->\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"Living Without Atomic Clocks #databases #time #GPS #CockroachDB","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"_links_to":"","_links_to_target":""},"categories":[1,18,62],"tags":[3506,1559,1081,239],"keyring_services":[],"class_list":["post-27511","post","type-post","status-publish","format-standard","hentry","category-general","category-programming","category-technology","tag-cockroachdb","tag-databases","tag-gps","tag-time"],"aioseo_notices":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack-related-posts":[{"id":8779,"url":"https:\/\/mamchenkov.net\/wordpress\/2005\/04\/06\/oopsy-those-were-three-hours-not-two\/","url_meta":{"origin":27511,"position":0},"title":"Oopsy&#8230; those were three hours, not two!","author":"Leonid Mamchenkov","date":"April 6, 2005","format":false,"excerpt":"Maxim eats about every three hours. Sometimes two and a half. If he starts demanding food after only two hours since last feeding, than either Olga or I start playing with him, trying to win some time. And usually it works. Anything from half an hour to an hour is\u2026","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":9624,"url":"https:\/\/mamchenkov.net\/wordpress\/2005\/10\/30\/clock-sync\/","url_meta":{"origin":27511,"position":1},"title":"Clock sync","author":"Leonid Mamchenkov","date":"October 30, 2005","format":false,"excerpt":"If you come too early everywhere today, that's because everyone changed to the winter time, except you. Yes, that's right, you have to set your watches one hour back. This clock sync has been the most organized, routine, and expected for me ever. Never ever did I manage to remember\u2026","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":22262,"url":"https:\/\/mamchenkov.net\/wordpress\/2014\/07\/25\/git-fat-simple-way-to-handle-fat-files-without-committing-them-to-git-supports-synchronization-using-rsync\/","url_meta":{"origin":27511,"position":2},"title":"git-fat &#8211; simple way to handle fat files without committing them to git, supports synchronization using rsync","author":"Leonid Mamchenkov","date":"July 25, 2014","format":"link","excerpt":"git-fat - simple way to handle fat files without committing them to git, supports synchronization using rsync","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":8998,"url":"https:\/\/mamchenkov.net\/wordpress\/2005\/05\/24\/reminder-about-ntp\/","url_meta":{"origin":27511,"position":3},"title":"Reminder about NTP","author":"Leonid Mamchenkov","date":"May 24, 2005","format":false,"excerpt":"NTP - Network Time Protocol allows for automatic and precise time synchronization over the network. There are many problems that can be caused by incorrect time - starting from logs confusions and going to software locks due to file timestamps. Configuring NTP is very easy. Just install the ntp RPM\u2026","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":8745,"url":"https:\/\/mamchenkov.net\/wordpress\/2005\/03\/27\/day-time-saving\/","url_meta":{"origin":27511,"position":4},"title":"Day time saving","author":"Leonid Mamchenkov","date":"March 27, 2005","format":false,"excerpt":"Day time saving is cutting yet another hour of sleep. This seems totally unfair from a young parent point of view. We don't see more of the day light just because we moved our clocks one hour forward...","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":9674,"url":"https:\/\/mamchenkov.net\/wordpress\/2005\/11\/16\/daily-del-icio-us-bookmarks\/","url_meta":{"origin":27511,"position":5},"title":"Daily del.icio.us bookmarks","author":"Leonid Mamchenkov","date":"November 16, 2005","format":false,"excerpt":"Shared bookmarks for del.icio.us user tvset on 2005-11-15 The Leap Second -- From the i-really-hate-the-way-we-measure-time department. Tagged as: clocks news science space time world \u042e\u043d\u0438\u043a\u0441\u043e\u0432\u0430\u044f \u0444\u0430\u043c\u0438\u043b\u0438\u044f Tagged as: article humor linux literature names reading story surname unix","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"jetpack_sharing_enabled":true,"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/posts\/27511","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/comments?post=27511"}],"version-history":[{"count":0,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/posts\/27511\/revisions"}],"wp:attachment":[{"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/media?parent=27511"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/categories?post=27511"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/tags?post=27511"},{"taxonomy":"keyring_services","embeddable":true,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/keyring_services?post=27511"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}