# Hybrid Logical Clocks

> A mechanism that combines physical time with a logical counter, so timestamps follow causal order and stay close to wall-clock time.

Record: `architecture:hybrid-logical-clocks`
Kind: mechanism
Layer: [Causality Core](https://banes-lab.com/records/layer/causality-core.md)
Severity: contextual
Scope: event, distributed state, time
Canonical: https://banes-lab.com/ontology#architecture-hybrid-logical-clocks

Listed in [Architecture principles](https://banes-lab.com/api/records/architecture.md), after [Lamport Clocks](https://banes-lab.com/records/architecture/lamport-clocks.md) and before [CRDTs](https://banes-lab.com/records/architecture/crdts.md).

## Repair

- Refactored by: Adopt Hybrid Logical Clocks
- Detected by: last-writer-wins on physical time
- Violated by: ordering events solely by wall-clock timestamps
- Measured by: out-of-causal-order event rate
- Enforced by: distributed-systems review

## Requires

- [Happens-Before Relationship](https://banes-lab.com/records/architecture/happens-before-relationship.md)

## Reinforces

- [Causal Consistency](https://banes-lab.com/records/architecture/causal-consistency.md)
- [Event Ordering](https://banes-lab.com/records/architecture/event-ordering.md)

## Enables

- [Wall-Clock-Correlated Causal Order](https://banes-lab.com/records/lexicon/wall-clock-correlated-causal-order.md)

## Conflicts with

- [Physical-Clock-Only Ordering](https://banes-lab.com/records/lexicon/physical-clock-only-ordering.md)

## In tension with

- [Clock Skew](https://banes-lab.com/records/lexicon/clock-skew.md)

## Tensions

- [Hybrid Logical Clocks / Clock Skew](https://banes-lab.com/records/tension/clock-skew-hybrid-logical-clocks.md)

## Severity

- [contextual](https://banes-lab.com/records/vocabulary/severity-contextual.md)

## Category

- [Causality / Ordering / Distributed Time](https://banes-lab.com/records/architecture-category/causality-ordering-distributed-time.md)

## Linked from

- [Execution joins the halves](https://banes-lab.com/software-architecture/principles/execution-joins-the-halves.md)
- [Causality / Ordering / Distributed Time](https://banes-lab.com/ontology/principles/architecture-category-causality-ordering-distributed-time.md)
- [Causality / Ordering / Distributed Time](https://banes-lab.com/ontology/lexicon/lexicon-category-causality-ordering-distributed-time.md)
- [Severity levels](https://banes-lab.com/ontology/schema/the-vocabulary-severity.md)
- [The resolutions](https://banes-lab.com/ontology/schema/the-resolutions.md)
