Urgent.News

What's breaking now, across thousands of outlets.

Tech

Clock Synchronization in Distributed Databases

Part 1: The Physical Clock Problem, Quartz, NTP, and Why Time Lies This is Part 1 of a 5-part series on clock synchronization in distributed databases, covering CockroachDB and Aurora DSQL. Part 1 : The Physical Clock Problem (you are here) Part 2 : Atomic Clocks, The Source of Truth Part 3 : The Hybrid Logical Clock, CockroachDB's Solution Part 4 : Uncertainty Intervals, MVCC, and Transaction…

Abstract editorial illustration

Time remains an elusive concept, particularly when managing databases across multiple servers in diverse geographic locations. Every transaction in such a system requires a timestamp, which in turn triggers two key aspects: managing versions of rows through Multi-Version Concurrency Control (MVCC) and ensuring serializability by identifying potential conflicts between concurrent transactions.

The inherent flaw in relying on physical clocks across different machines lies in their inexact synchronization - they drift, jump, and often disagree. If databases were to trust these clocks without verification, they would encounter subtle and challenging-to-detect consistency issues.

This five-part series explores how CockroachDB and Aurora DSQL handle this critical challenge, commencing from the physical principles of quartz oscillator clocks, progressing through Network Time Protocol (NTP) and atomic clocks, and ultimately arriving at the implementation of bounded uncertainty intervals and transaction restarts. The first part of the series, "The Physical Clock Problem," lays the groundwork for understanding the intricacies of time management in distributed databases.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

A Different Kind of Content

Writing With AI — Part Two Last time, I told you where this loop came from — a year of an AI telling me my architecture ideas were great, a manual workaround that only half worked, and a skill that…

More from Friday 7 August →