Back to Playground

Vector Clocks

Vector clocks track causality in distributed systems. They determine if events are causally related (one happened-before another) or concurrent (no causal ordering).

Node A

[0, 0, 0]
Send to:

Node B

[0, 0, 0]
Send to:

Node C

[0, 0, 0]
Send to:

Event History

Select 2 events to compare their causality

No events yet. Click buttons above to generate events.

Causality Comparison

Select 2 events from the history

to compare their causal relationship

How Vector Clocks Work

Increment Rule

On any local event or send, increment your own position in the vector.

Merge Rule

On receive, take element-wise max of local and received clocks, then increment.

Causality Detection

A → B if all components of A ≤ B and at least one is strictly less. Otherwise concurrent.