Lack of Global Clock
What You'll Learn
You'll discover why distributed systems cannot have perfectly synchronized clocks and how this fundamental limitation complicates event ordering and coordination.
The Impossibility of Perfect Synchronization
In a distributed system, there is no global clock that all nodes agree upon with perfect accuracy. Unlike a single-machine program where you can trust System.currentTimeMillis() to order events, distributed nodes each have their own physical clocks that drift at slightly different rates due to hardware variations, temperature, and other environmental factors.
Even if you synchronize clocks using protocols like NTP (Network Time Protocol), you only achieve approximate synchronization within milliseconds or microseconds. Network latency—the time messages take to travel—means you can never guarantee two distant nodes read "the same time" at "the same instant."
Why This Matters
Without a global clock, you cannot use timestamps alone to determine which event happened first. If Node A records an event at 10:00:00.001 and Node B records an event at 10:00:00.000, did B's event actually happen first? Not necessarily—Node A's clock might simply be running fast.
This creates problems for:
- Ordering events: Determining causality (did A cause B?)
- Coordinating actions: Agreeing when to start a distributed transaction
- Detecting failures: Deciding if a node is slow or crashed (the partial failure problem you've seen)
- Ensuring consistency: Merging concurrent updates to replicated data
Key Takeaway: Distributed systems cannot rely on synchronized clocks for correctness; instead, they use logical clocks (like Lamport timestamps) and consensus algorithms to establish event ordering and coordinate actions without assuming perfect time synchronization.