Image for Vector Clocks

Vector Clocks

Vector clocks are a method used in distributed systems to track the order of events across multiple computers. Each computer maintains a list (vector) of counters, one for itself and one for each other system. When an event occurs, the system updates its own counter, and when messages are exchanged, they include these vectors. By comparing vectors, systems can determine if one event happened before another, after, or if they are concurrent (independent). This helps coordinate actions and maintain consistency without relying on a single global clock, effectively capturing the causal relationships between events in a distributed environment.