Pattern 47 / CONSENSUS

Vector Clocks

Use this when detecting causal ordering without a global clock.

Pressure
Detecting causal ordering without a global clock
Mechanism
Each node maintains a vector of logical counters and compares vectors to find before/after/concurrent events
Toll
Metadata grows with node count and conflicts still need resolution policy
Architecture plate47
Diagram for Vector Clocks
Executive brief

Vector Clocks fits when detecting causal ordering without a global clock. Mechanism: each node maintains a vector of logical counters and compares vectors to find before/after/concurrent events. Use it for conflict detection, distributed databases, sync engines, and offline collaboration. The toll: metadata grows with node count and conflicts still need resolution policy.

Use when

Conflict detection, distributed databases, sync engines, and offline collaboration.

Example

Two offline edits detected as concurrent and merged later.

Review framing

Describe the pressure first, then the mechanism, then the cost. That keeps the design grounded.

Same pressure family

Consistency Patterns

44Two-Phase Commit (2PC)45Saga Pattern46Quorum
โ† 4648 โ†’