Definition
Vector clocks encode causality between writes, while timestamps impose an ordering that may lose concurrent updates.
Key Concepts
- Vector clocks detect true concurrency.
- Timestamps are simple but clock-skew sensitive.
- Last-write-wins favors operational simplicity over correctness depth.
- Conflict strategy determines data-loss profile.
How It Works
Each write carries either a vector version map or a scalar timestamp; reconciliation uses causality checks or max-timestamp selection.
Comparison Table
| Approach | Pros | Cons |
|---|---|---|
| Vector clocks | Causal accuracy | Higher metadata/complexity |
| Timestamps | Simple and fast | Can drop concurrent intent |
Production Implications
Amazon Dynamo used vector clocks to surface sibling versions, while Apache Cassandra typically resolves by timestamp. Teams often add idempotency keys and domain merges above storage to avoid silent data loss.
When to Use / Not Use
Use It When
- Vector clocks for correctness-sensitive merges.
- Timestamps for operationally simple, high-volume workloads.
Avoid It When
- Timestamp-only merges for user-authored collaborative content.
- Vector clocks where metadata overhead is unacceptable.
Key Takeaways
- Start with user-visible correctness requirements, then choose the weakest model that still preserves them.
- Instrument staleness and conflict rates; treat them as first-class production metrics.
- Design reconciliation and repair workflows before incidents force ad-hoc fixes.