# Lamport Clocks

> A mechanism that stamps each event with a logical counter, advanced on every send and receive, to give a partial order.

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

Listed in [Architecture principles](https://banes-lab.com/api/records/architecture.md), after [Vector Clocks](https://banes-lab.com/records/architecture/vector-clocks.md) and before [Hybrid Logical Clocks](https://banes-lab.com/records/architecture/hybrid-logical-clocks.md).

## Repair

- Refactored by: Add Logical Clock
- Detected by: timestamp ordering anomalies
- Violated by: ordering by unsynchronized wall clocks
- Measured by: ordering anomaly rate
- Enforced by: protocol tests

## Requires

- [Logical Counter](https://banes-lab.com/records/lexicon/logical-counter.md)

## Reinforces

- [Happens-Before Reasoning](https://banes-lab.com/records/lexicon/happens-before-reasoning.md)

## Enables

- [Partial Ordering](https://banes-lab.com/records/lexicon/partial-ordering.md)

## Conflicts with

- [Wall-Clock Ordering Assumption](https://banes-lab.com/records/lexicon/wall-clock-ordering-assumption.md)

## In tension with

- [No Concurrent Causality Distinction](https://banes-lab.com/records/lexicon/no-concurrent-causality-distinction.md)

## Tensions

- [Lamport Clocks / No Concurrent Causality Distinction](https://banes-lab.com/records/tension/lamport-clocks-no-concurrent-causality-distinction.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/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)
