AlgoMaster Logo

Vector Clocks

Ashish

Ashish Pratap Singh

4 min read

Imagine two users, Alice in New York and Bob in London, editing the same document at nearly the same time. Both hit Save, and the system receives their updates seconds apart.

Now the big question: Which version is the latest?

In a centralized system, it’s simple, just compare timestamps. But in a distributed system, where servers have independent clocks that drift, this becomes tricky. There’s no single source of truth for “time.”

To maintain consistency, systems must determine if one event happened before another, or if they happened concurrently.

That’s where Vector Clocks come in.

1. Event Ordering in Distributed Systems

Premium Content

This content is for premium members only.