Vector Clocks and Logical Time in Distributed Systems
Issue #54 System Design Interview Roadmap
When your distributed system starts processing millions of events per second across dozens of data centers, you'll discover something unsettling: time isn't what you think it is. That innocent-looking timestamp field in your event logs? It's lying to you. The System.currentTimeMillis()
call that seemed so reliable in your monolithic application? It's become your enemy in the distributed world.
Today, we're diving into one of the most elegant solutions to this fundamental problem: vector clocks. But this isn't just another academic exercise. By the end of this article, you'll understand why companies like Amazon built DynamoDB's conflict resolution around vector clocks, and why understanding logical time can save you from some of the most insidious bugs in distributed systems.