System Design Patterns: From Fundamentals to Real Systems
0% completed
Vector Clocks
Two writes reach Maya Ortiz's cart less than 30 ms apart. Replica A stamped the write from her phone with the time 10:00:00.120. Replica B stamped the write from her laptop with 10:00:00.090. Which write happened first?
The stamps say the laptop's write came first, by 30 ms, and that answer is wrong. Replica B's clock runs 45 ms slow, so the laptop's write really happened at 10:00:00.135, which is 15 ms after the phone's write. However, the correct order would not help much either. The useful question is whether either write knew about the other, and here neither did.
.....
.....
.....
Like the course? Get enrolled and start learning!
Reading Progress
0%