A vector clock is a logical timestamp mechanism used in distributed systems to capture the partial ordering of events and detect causal relationships between them. Each node in the system maintains a vector—an array of counters—with one entry for every other node. When a node performs an operation, it increments its own counter in the vector. By comparing the vectors from different nodes, the system can determine if one event happened-before another, enabling consistent state management without a global clock.
