# Latency

> A measure of the time between a request and its response, usually reported at percentiles.

Record: `architecture:latency`
Kind: metric
Layer: [Performance Core](https://banes-lab.com/records/layer/performance-core.md)
Severity: contextual
Scope: API, service, user flow
Canonical: https://banes-lab.com/ontology#architecture-latency

Listed in [Architecture principles](https://banes-lab.com/api/records/architecture.md), after [Throughput](https://banes-lab.com/records/architecture/throughput.md) and before [Performance Engineering](https://banes-lab.com/records/architecture/performance-engineering.md).

## Repair

- Refactored by: Cache, Async Offload, Optimize Query
- Detected by: trace span delays
- Violated by: response time above SLO
- Measured by: p50/p95/p99 latency
- Enforced by: SLO gates

## Requires

- [Time Budget](https://banes-lab.com/records/lexicon/time-budget.md)

## Reinforces

- [User Experience](https://banes-lab.com/records/lexicon/user-experience.md)
- [Performance Engineering](https://banes-lab.com/records/architecture/performance-engineering.md)

## Enables

- [Responsiveness](https://banes-lab.com/records/lexicon/responsiveness.md)

## Conflicts with

- [Long Blocking Work](https://banes-lab.com/records/lexicon/long-blocking-work.md)

## In tension with

- [Throughput/Batching](https://banes-lab.com/records/lexicon/throughput-batching.md)
- [Total-Order Broadcast](https://banes-lab.com/records/architecture/total-order-broadcast.md)
- [CAP Theorem](https://banes-lab.com/records/architecture/cap-theorem.md)
- [Consensus](https://banes-lab.com/records/architecture/consensus.md)
- [Message Queue](https://banes-lab.com/records/architecture/message-queue.md)
- [Throughput](https://banes-lab.com/records/architecture/throughput.md)
- [Consistency](https://banes-lab.com/records/architecture/consistency.md)
- [Pessimistic Locking](https://banes-lab.com/records/architecture/pessimistic-locking.md)
- [Total-Order Broadcast / Latency](https://banes-lab.com/records/tension/latency-total-order-broadcast.md)
- [CAP Theorem / Latency](https://banes-lab.com/records/tension/cap-theorem-latency.md)
- [Consensus / Latency](https://banes-lab.com/records/tension/consensus-latency.md)
- [Message Queue / Latency](https://banes-lab.com/records/tension/latency-message-queue.md)
- [Throughput / Latency](https://banes-lab.com/records/tension/latency-throughput.md)
- [Consistency / Latency](https://banes-lab.com/records/tension/consistency-latency.md)
- [Pessimistic Locking / Latency](https://banes-lab.com/records/tension/latency-pessimistic-locking.md)

## Tensions

- [Latency / Throughput/Batching](https://banes-lab.com/records/tension/latency-throughput-batching.md)

## Severity

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

## Category

- [Scalability / Performance / Optimization](https://banes-lab.com/records/architecture-category/scalability-performance-optimization.md)

## Reinforced by

- [PACELC Theorem](https://banes-lab.com/records/architecture/pacelc-theorem.md)
- [CDN / Edge Caching](https://banes-lab.com/records/architecture/cdn-edge-caching.md)
- [Queuing Theory](https://banes-lab.com/records/architecture/queuing-theory.md)

## Linked from

- [Causality / Ordering / Distributed Time](https://banes-lab.com/ontology/principles/architecture-category-causality-ordering-distributed-time.md)
- [Control / Coordination / Centralization](https://banes-lab.com/ontology/principles/architecture-category-control-coordination-centralization.md)
- [Event / Messaging / Asynchronous Architecture](https://banes-lab.com/ontology/principles/architecture-category-event-messaging-asynchronous-architecture.md)
- [Model Architecture](https://banes-lab.com/ontology/principles/architecture-category-model-architecture.md)
- [Scalability / Performance / Optimization](https://banes-lab.com/ontology/principles/architecture-category-scalability-performance-optimization.md)
- [Transactions / State / Concurrency](https://banes-lab.com/ontology/principles/architecture-category-transactions-state-concurrency.md)
- [Core Vocabulary](https://banes-lab.com/ontology/lexicon/lexicon-category-core-vocabulary.md)
- [Quality Attributes](https://banes-lab.com/ontology/lexicon/lexicon-category-quality-attributes.md)
- [Scalability / Performance / Optimization](https://banes-lab.com/ontology/lexicon/lexicon-category-scalability-performance-optimization.md)
- [Severity levels](https://banes-lab.com/ontology/schema/the-vocabulary-severity.md)
- [The resolutions](https://banes-lab.com/ontology/schema/the-resolutions.md)
