# Scalability / Performance / Optimization

> Every principle in this category is listed as a record.

Page: Ontology · Principles
Canonical: https://banes-lab.com/ontology#arch-category-scalability-performance-optimization

Every principle in this category is listed as a record. Each record carries its kind, its severity, the scopes it applies at and the layer it lives in, then the edge relations that join it to other records, the records that point back at it, the contracts that answer to it and the tensions it takes part in. The descriptors say how it is violated, detected, measured, repaired and enforced. Where the record carries one, an exemplar shows the shape before and after the principle is applied.

Relations diagram

The relations inside this category.

```mermaid
flowchart LR
n_scalability["Scalability"]
n_horizontal_scaling["Horizontal Scaling"]
n_vertical_scaling["Vertical Scaling"]
n_elasticity["Elasticity"]
n_load_balancing["Load Balancing"]
n_sharding["Sharding"]
n_partitioning["Partitioning"]
n_caching["Caching"]
n_statelessness["Statelessness"]
n_concurrency["Concurrency"]
n_parallelism["Parallelism"]
n_throughput["Throughput"]
n_latency["Latency"]
n_performance_engineering["Performance Engineering"]
n_algorithmic_efficiency["Algorithmic Efficiency"]
n_time_complexity["Time Complexity"]
n_space_complexity["Space Complexity"]
n_big_o_notation["Big O Notation"]
n_optimization["Optimization"]
n_profiling["Profiling"]
n_benchmarking["Benchmarking"]
n_bottleneck_analysis["Bottleneck Analysis"]
n_resource_utilization["Resource Utilization"]
n_rate_limiting["Rate Limiting"]
n_memory_efficiency["Memory Efficiency"]
n_cdn_edge_caching["CDN / Edge Caching"]
n_read_replica["Read Replica"]
n_queuing_theory["Queuing Theory"]
n_scalability --> n_performance_engineering
n_horizontal_scaling --> n_elasticity
n_elasticity --> n_scalability
n_load_balancing --> n_scalability
n_sharding --> n_horizontal_scaling
n_partitioning --> n_scalability
n_partitioning --> n_parallelism
n_caching --> n_scalability
n_statelessness --> n_horizontal_scaling
n_statelessness --> n_load_balancing
n_concurrency --> n_throughput
n_parallelism --> n_throughput
n_throughput --> n_scalability
n_throughput -.-> n_latency
n_latency --> n_performance_engineering
n_performance_engineering --> n_profiling
n_performance_engineering --> n_benchmarking
n_performance_engineering --> n_scalability
n_algorithmic_efficiency --> n_scalability
n_time_complexity --> n_algorithmic_efficiency
n_time_complexity -.-> n_space_complexity
n_space_complexity --> n_resource_utilization
n_space_complexity -.-> n_time_complexity
n_big_o_notation --> n_algorithmic_efficiency
n_optimization --> n_profiling
n_optimization --> n_performance_engineering
n_profiling --> n_performance_engineering
n_benchmarking --> n_performance_engineering
n_bottleneck_analysis --> n_profiling
n_bottleneck_analysis --> n_optimization
n_resource_utilization --> n_performance_engineering
n_memory_efficiency --> n_scalability
n_cdn_edge_caching --> n_caching
n_cdn_edge_caching --> n_latency
n_read_replica --> n_horizontal_scaling
n_read_replica --> n_load_balancing
n_queuing_theory --> n_latency
```

### Scalability

- Kind: [quality-attribute](https://banes-lab.com/records/kind/quality-attribute.md)
- Severity: contextual
- Scope: service, system, infrastructure
- Layer: [Performance Core](https://banes-lab.com/records/layer/performance-core.md)

Details

Requires
[Load Model](https://banes-lab.com/records/lex/load-model.md), [Bottleneck Awareness](https://banes-lab.com/records/lex/bottleneck-awareness.md)

Reinforces
[Performance Engineering](https://banes-lab.com/records/arch/performance-engineering.md)

Enables
[Growth Handling](https://banes-lab.com/records/lex/growth-handling.md)

In tension with
[Simplicity](https://banes-lab.com/records/lex/simplicity.md), [Consistency](https://banes-lab.com/records/arch/consistency.md)

Conflicts with
[Fixed-Capacity Design](https://banes-lab.com/records/lex/fixed-capacity-design.md)

Referenced by
[Microservices](https://banes-lab.com/records/arch/microservices.md), [Message Broker](https://banes-lab.com/records/arch/message-broker.md), [CQRS](https://banes-lab.com/records/arch/command-query-responsibility-segregation.md), [Eventual Consistency](https://banes-lab.com/records/arch/eventual-consistency.md), [Service Discovery](https://banes-lab.com/records/arch/service-discovery.md), [Elasticity](https://banes-lab.com/records/arch/elasticity.md), [Load Balancing](https://banes-lab.com/records/arch/load-balancing.md), [Partitioning](https://banes-lab.com/records/arch/partitioning.md), [Caching](https://banes-lab.com/records/arch/caching.md), [Throughput](https://banes-lab.com/records/arch/throughput.md), [Performance Engineering](https://banes-lab.com/records/arch/performance-engineering.md), [Algorithmic Efficiency](https://banes-lab.com/records/arch/algorithmic-efficiency.md), [Memory Efficiency](https://banes-lab.com/records/arch/memory-efficiency.md), [Replication](https://banes-lab.com/records/arch/replication.md), [Stateless Processing](https://banes-lab.com/records/arch/stateless-processing.md)

Tensions
[Scalability Simplicity](https://banes-lab.com/records/tension/scalability-simplicity.md), [Scalability Consistency](https://banes-lab.com/records/tension/consistency-scalability.md)

Violated by
single bottleneck preventing growth

Detected by
saturation under load test

Measured by
throughput under increasing load

Refactored by
Add Caching, [Partitioning](https://banes-lab.com/records/arch/partitioning.md), Async Processing, Scaling

Enforced by
load tests, SLO gates

Before

```typescript
class FooServer {
private readonly foos = new Map<FooId, Foo>();
handle(request: FooRequest) { return processFoo(request, this.foos); }
}
```

After

```typescript
class FooServer {
constructor(private readonly store: DistributedFooStore) {}
handle(request: FooRequest) { return processFoo(request, this.store); }
}
```

### Horizontal Scaling

- Kind: [technique](https://banes-lab.com/records/kind/technique.md)
- Severity: contextual
- Scope: service, infrastructure
- Layer: [Performance Core](https://banes-lab.com/records/layer/performance-core.md)

Details

Requires
[Statelessness or Shared State Strategy](https://banes-lab.com/records/lex/statelessness-or-shared-state-strategy.md)

Reinforces
[Elasticity](https://banes-lab.com/records/arch/elasticity.md), [Availability](https://banes-lab.com/records/lex/availability.md)

Enables
[Scale-Out](https://banes-lab.com/records/lex/scale-out.md)

In tension with
[Distributed Coordination](https://banes-lab.com/records/lex/distributed-coordination.md)

Conflicts with
[Instance-Local State](https://banes-lab.com/records/lex/instance-local-state.md)

Referenced by
[Space-Based Architecture](https://banes-lab.com/records/arch/space-based-architecture.md), [Competing Consumers](https://banes-lab.com/records/arch/competing-consumers.md), [Sharding](https://banes-lab.com/records/arch/sharding.md), [Statelessness](https://banes-lab.com/records/arch/statelessness.md), [Read Replica](https://banes-lab.com/records/arch/read-replica.md)

Tensions
[Horizontal Scaling Distributed Coordination](https://banes-lab.com/records/tension/distributed-coordination-horizontal-scaling.md)

Violated by
sticky instance state required for correctness

Detected by
local session/state coupling

Measured by
scale-out efficiency

Refactored by
Externalize State, Add Load Balancer

Enforced by
deployment tests

Before

```typescript
deployFoo({ replicas: 1, cpu: 32, memoryGb: 128 });
```

After

```typescript
deployFoo({ replicas: 12, cpu: 2, memoryGb: 4, stateless: true });
```

### Vertical Scaling

- Kind: [technique](https://banes-lab.com/records/kind/technique.md)
- Severity: contextual
- Scope: infrastructure, process
- Layer: [Performance Core](https://banes-lab.com/records/layer/performance-core.md)

Details

Requires
[Resource Headroom](https://banes-lab.com/records/lex/resource-headroom.md)

Reinforces
[Simplicity](https://banes-lab.com/records/lex/simplicity.md)

Enables
[Capacity Increase without Distribution](https://banes-lab.com/records/lex/capacity-increase-without-distribution.md)

In tension with
[Cost/Limit](https://banes-lab.com/records/lex/cost-limit.md)

Conflicts with
[Hard Resource Ceiling](https://banes-lab.com/records/lex/hard-resource-ceiling.md)

Tensions
[Vertical Scaling Cost/Limit](https://banes-lab.com/records/tension/cost-limit-vertical-scaling.md)

Violated by
relying only on vertical scale past ceiling

Detected by
resource saturation trends

Measured by
utilization/headroom

Refactored by
Optimize Resources, Prepare Horizontal Scale

Enforced by
[capacity planning](https://banes-lab.com/records/lex/capacity-planning.md)

Before

```typescript
deployFoo({ cpu: 1, memoryGb: 1 });
queueFooWhenSaturated();
```

After

```typescript
deployFoo({ cpu: 8, memoryGb: 32 });
verifyFooCapacity({ targetConcurrency: 200 });
```

### Elasticity

- Kind: [quality-attribute](https://banes-lab.com/records/kind/quality-attribute.md)
- Severity: contextual
- Scope: deployment, infrastructure
- Layer: [Performance Core](https://banes-lab.com/records/layer/performance-core.md)

Details

Requires
[Auto-Scaling](https://banes-lab.com/records/arch/auto-scaling.md), [Metrics](https://banes-lab.com/records/lex/metrics.md)

Reinforces
[Scalability](https://banes-lab.com/records/arch/scalability.md), [Cost Efficiency](https://banes-lab.com/records/lex/cost-efficiency.md)

Enables
[Dynamic Capacity](https://banes-lab.com/records/lex/dynamic-capacity.md)

In tension with
[Warm-Up Latency](https://banes-lab.com/records/lex/warm-up-latency.md)

Conflicts with
[Fixed Provisioning](https://banes-lab.com/records/lex/fixed-provisioning.md)

Referenced by
[Space-Based Architecture](https://banes-lab.com/records/arch/space-based-architecture.md), [Horizontal Scaling](https://banes-lab.com/records/arch/horizontal-scaling.md), [Auto-Scaling](https://banes-lab.com/records/arch/auto-scaling.md)

Tensions
[Elasticity Warm-Up Latency](https://banes-lab.com/records/tension/elasticity-warm-up-latency.md)

Violated by
capacity not adapting to demand

Detected by
under/over-provisioning patterns

Measured by
scale response time, utilization

Refactored by
Add Scaling Policy, Remove Stateful Constraint

Enforced by
infrastructure policy

Before

```typescript
deployFooWorkers({ replicas: 10 });
```

After

```typescript
deployFooWorkers({
minReplicas: 2,
maxReplicas: 50,
target: { queueDepthPerReplica: 100 },
});
```

### Load Balancing

- Kind: [mechanism](https://banes-lab.com/records/kind/mechanism.md)
- Severity: contextual
- Scope: traffic, service
- Layer: [Performance Core](https://banes-lab.com/records/layer/performance-core.md)

Details

Requires
[Multiple Targets](https://banes-lab.com/records/lex/multiple-targets.md), [Health Checks](https://banes-lab.com/records/arch/health-checks.md)

Reinforces
[Availability](https://banes-lab.com/records/lex/availability.md), [Scalability](https://banes-lab.com/records/arch/scalability.md)

Enables
[Traffic Distribution](https://banes-lab.com/records/lex/traffic-distribution.md)

In tension with
[Session Affinity](https://banes-lab.com/records/lex/session-affinity.md)

Conflicts with
[Single Target Routing](https://banes-lab.com/records/lex/single-target-routing.md)

Referenced by
[Competing Consumers](https://banes-lab.com/records/arch/competing-consumers.md), [Statelessness](https://banes-lab.com/records/arch/statelessness.md), [Read Replica](https://banes-lab.com/records/arch/read-replica.md), [Health Checks](https://banes-lab.com/records/arch/health-checks.md)

Tensions
[Load Balancing Session Affinity](https://banes-lab.com/records/tension/load-balancing-session-affinity.md)

Violated by
uneven traffic causing hotspots

Detected by
skewed instance utilization

Measured by
request distribution, [latency](https://banes-lab.com/records/arch/latency.md)

Refactored by
Add Load Balancer, Externalize Session State

Enforced by
infrastructure config checks

Before

```typescript
const endpoint = fooServers[0];
endpoint.handle(request);
```

After

```typescript
const endpoint = fooLoadBalancer.next({ key: request.fooId });
endpoint.handle(request);
```

### Sharding

- Kind: [pattern](https://banes-lab.com/records/kind/pattern.md)
- Severity: contextual
- Scope: database, storage, messaging
- Layer: [Performance Core](https://banes-lab.com/records/layer/performance-core.md)

Details

Requires
[Partition Key](https://banes-lab.com/records/lex/partition-key.md)

Reinforces
[Horizontal Scaling](https://banes-lab.com/records/arch/horizontal-scaling.md)

Enables
[Large Dataset Scaling](https://banes-lab.com/records/lex/large-dataset-scaling.md)

In tension with
[Cross-Shard Queries](https://banes-lab.com/records/lex/cross-shard-queries.md)

Conflicts with
[Single Monolithic Store](https://banes-lab.com/records/lex/single-monolithic-store.md)

Tensions
[Sharding Cross-Shard Queries](https://banes-lab.com/records/tension/cross-shard-queries-sharding.md)

Violated by
unbounded single partition growth

Detected by
hotspot partitions, storage bottleneck

Measured by
shard balance, query fan-out

Refactored by
Introduce Shard Key, Split Data

Enforced by
data architecture review

Before

```typescript
const foo = await singleFooDatabase.find(id);
```

After

```typescript
const shard = fooShardMap.resolve(id);
const foo = await shard.find(id);
```

### Partitioning

- Kind: [technique](https://banes-lab.com/records/kind/technique.md)
- Severity: contextual
- Scope: data, workload, service
- Layer: [Performance Core](https://banes-lab.com/records/layer/performance-core.md)

Details

Requires
[Partition Strategy](https://banes-lab.com/records/lex/partition-strategy.md)

Reinforces
[Scalability](https://banes-lab.com/records/arch/scalability.md), [Isolation](https://banes-lab.com/records/arch/isolation.md)

Enables
[Parallelism](https://banes-lab.com/records/arch/parallelism.md)

In tension with
[Rebalancing Complexity](https://banes-lab.com/records/lex/rebalancing-complexity.md)

Conflicts with
[Global Shared State](https://banes-lab.com/records/lex/global-shared-state.md)

Tensions
[Partitioning Rebalancing Complexity](https://banes-lab.com/records/tension/partitioning-rebalancing-complexity.md)

Violated by
no partitioning for unbounded workload

Detected by
hotspot resource usage

Measured by
partition balance

Refactored by
Add Partition Key, Split Workload

Enforced by
[architecture review](https://banes-lab.com/records/arch/architecture-review.md)

Before

```typescript
const events = await fooLog.readAll();
```

After

```typescript
const partition = hash(fooId) % partitionCount;
const events = await fooLog.readPartition(partition);
```

### Caching

- Kind: [pattern](https://banes-lab.com/records/kind/pattern.md)
- Severity: contextual
- Scope: data access, computation, API
- Layer: [Performance Core](https://banes-lab.com/records/layer/performance-core.md)

Details

Requires
[Invalidation Policy](https://banes-lab.com/records/lex/invalidation-policy.md)

Reinforces
[Latency Reduction](https://banes-lab.com/records/lex/latency-reduction.md), [Scalability](https://banes-lab.com/records/arch/scalability.md)

Enables
[Reduced Load](https://banes-lab.com/records/lex/reduced-load.md)

In tension with
[Consistency](https://banes-lab.com/records/arch/consistency.md), [Always-Fresh Reads](https://banes-lab.com/records/lex/always-fresh-reads.md)

Conflicts with
[Cache Poisoning by Design](https://banes-lab.com/records/arch/cache-poisoning-by-design.md)

Referenced by
[CDN / Edge Caching](https://banes-lab.com/records/arch/cdn-edge-caching.md)

Tensions
[Caching Consistency](https://banes-lab.com/records/tension/caching-consistency.md), [Caching Always-Fresh Reads](https://banes-lab.com/records/tension/always-fresh-reads-caching.md)

Violated by
repeated expensive computation/query with stable result

Detected by
hot repeated reads, high latency calls

Measured by
hit ratio, stale read rate

Refactored by
Add Cache, Define TTL/Invalidation

Enforced by
performance tests

Before

```typescript
async function loadFoo(id: FooId) { return fooStore.find(id); }
```

After

```typescript
async function loadFoo(id: FooId) {
const cached = await fooCache.get(id);
if (cached) return cached;
const foo = await fooStore.find(id);
if (foo) await fooCache.set(id, foo, { ttlMs: 60_000 });
return foo;
}
```

### Statelessness

- Kind: [principle](https://banes-lab.com/records/kind/principle.md)
- Severity: recommended
- Scope: service, process, handler
- Layer: [Performance Core](https://banes-lab.com/records/layer/performance-core.md)

Details

Requires
[Externalized State](https://banes-lab.com/records/lex/externalized-state.md)

Reinforces
[Horizontal Scaling](https://banes-lab.com/records/arch/horizontal-scaling.md), [Resilience](https://banes-lab.com/records/arch/resilience.md)

Enables
[Load Balancing](https://banes-lab.com/records/arch/load-balancing.md), [Auto-Scaling](https://banes-lab.com/records/arch/auto-scaling.md)

In tension with
[State Access Latency](https://banes-lab.com/records/lex/state-access-latency.md)

Conflicts with
[Instance Affinity](https://banes-lab.com/records/lex/instance-affinity.md), [Temporal Coupling](https://banes-lab.com/records/arch/temporal-coupling.md)

Tensions
[Statelessness State Access Latency](https://banes-lab.com/records/tension/state-access-latency-statelessness.md)

Violated by
correctness depends on in-memory instance state

Detected by
mutable static/session-local state

Measured by
state externalization coverage

Refactored by
Move State to Store, Use Token/Session Store

Enforced by
architecture tests

Before

```typescript
class FooHandler {
private currentUser?: User;
handle(request: Request) {
this.currentUser = request.user;
return processFoo(request, this.currentUser);
}
}
```

After

```typescript
class FooHandler {
handle(request: Request) {
return processFoo(request, request.user);
}
}
```

### Concurrency

- Kind: [model](https://banes-lab.com/records/kind/model.md)
- Severity: contextual
- Scope: runtime, service, algorithm
- Layer: [Performance Core](https://banes-lab.com/records/layer/performance-core.md)

Details

Requires
[Concurrency Control](https://banes-lab.com/records/arch/concurrency-control.md)

Reinforces
[Throughput](https://banes-lab.com/records/arch/throughput.md)

Enables
[Overlapping Work](https://banes-lab.com/records/lex/overlapping-work.md)

In tension with
[Complexity](https://banes-lab.com/records/lex/complexity.md)

Conflicts with
[Race Conditions](https://banes-lab.com/records/lex/race-conditions.md)

Tensions
[Concurrency Complexity](https://banes-lab.com/records/tension/complexity-concurrency.md)

Violated by
unsafe shared mutation

Detected by
data races, flaky concurrent tests

Measured by
[throughput](https://banes-lab.com/records/arch/throughput.md), race count

Refactored by
Add Synchronization, Use Immutable State

Enforced by
race detectors, [tests](https://banes-lab.com/records/lex/tests.md)

Before

```typescript
for (const foo of foos) await processFoo(foo);
```

After

```typescript
await Promise.all(foos.map(foo => processFoo(foo)));
```

### Parallelism

- Kind: [technique](https://banes-lab.com/records/kind/technique.md)
- Severity: contextual
- Scope: algorithm, processing, runtime
- Layer: [Performance Core](https://banes-lab.com/records/layer/performance-core.md)

Details

Requires
[Independent Work Units](https://banes-lab.com/records/lex/independent-work-units.md)

Reinforces
[Throughput](https://banes-lab.com/records/arch/throughput.md), [Performance](https://banes-lab.com/records/lex/performance.md)

Enables
[Multi-Core Utilization](https://banes-lab.com/records/lex/multi-core-utilization.md)

In tension with
[Coordination Overhead](https://banes-lab.com/records/lex/coordination-overhead.md)

Conflicts with
[Sequential Bottleneck](https://banes-lab.com/records/lex/sequential-bottleneck.md)

Referenced by
[Causality](https://banes-lab.com/records/arch/causality.md), [Partitioning](https://banes-lab.com/records/arch/partitioning.md), [Fan-out/Fan-in](https://banes-lab.com/records/arch/fan-out-fan-in.md)

Tensions
[Parallelism Coordination Overhead](https://banes-lab.com/records/tension/coordination-overhead-parallelism.md)

Violated by
serial processing of independent heavy tasks

Detected by
CPU bottlenecks with independent work

Measured by
speedup, utilization

Refactored by
Split Work, Add Parallel Execution

Enforced by
performance benchmarks

Before

```typescript
const results = foos.map(foo => cpuHeavyFoo(foo));
```

After

```typescript
const results = await workerPool.map(foos, foo => cpuHeavyFoo(foo));
```

### Throughput

- Kind: [metric](https://banes-lab.com/records/kind/metric.md)
- Severity: contextual
- Scope: service, pipeline, system
- Layer: [Performance Core](https://banes-lab.com/records/layer/performance-core.md)

Details

Requires
[Capacity Model](https://banes-lab.com/records/lex/capacity-model.md)

Reinforces
[Scalability](https://banes-lab.com/records/arch/scalability.md)

Enables
[Load Handling](https://banes-lab.com/records/lex/load-handling.md)

In tension with
[Latency](https://banes-lab.com/records/arch/latency.md)

Conflicts with
[Bottlenecks](https://banes-lab.com/records/lex/bottlenecks.md)

Referenced by
[Code Review](https://banes-lab.com/records/arch/code-review.md), [Event Ordering](https://banes-lab.com/records/arch/event-ordering.md), [PACELC Theorem](https://banes-lab.com/records/arch/pacelc-theorem.md), [Backpressure](https://banes-lab.com/records/arch/backpressure.md), [Concurrency](https://banes-lab.com/records/arch/concurrency.md), [Parallelism](https://banes-lab.com/records/arch/parallelism.md), [Fan-out/Fan-in](https://banes-lab.com/records/arch/fan-out-fan-in.md), [Isolation](https://banes-lab.com/records/arch/isolation.md)

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

Violated by
processing rate below SLO

Detected by
load test failures

Measured by
requests/messages/items per second

Refactored by
Optimize Bottleneck, Add Parallelism, Add Scaling

Enforced by
performance gates

Before

```typescript
for (const foo of foos) await fooStore.save(foo);
```

After

```typescript
for (const batch of chunk(foos, 500)) await fooStore.saveBatch(batch);
```

### Latency

- Kind: [metric](https://banes-lab.com/records/kind/metric.md)
- Severity: contextual
- Scope: API, service, user flow
- Layer: [Performance Core](https://banes-lab.com/records/layer/performance-core.md)

Details

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

Reinforces
[User Experience](https://banes-lab.com/records/lex/user-experience.md), [Performance Engineering](https://banes-lab.com/records/arch/performance-engineering.md)

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

In tension with
[Throughput/Batching](https://banes-lab.com/records/lex/throughput-batching.md)

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

Referenced by
[Total-Order Broadcast](https://banes-lab.com/records/arch/total-order-broadcast.md), [CAP Theorem](https://banes-lab.com/records/arch/cap-theorem.md), [PACELC Theorem](https://banes-lab.com/records/arch/pacelc-theorem.md), [Consensus](https://banes-lab.com/records/arch/consensus.md), [Message Queue](https://banes-lab.com/records/arch/message-queue.md), [Throughput](https://banes-lab.com/records/arch/throughput.md), [CDN / Edge Caching](https://banes-lab.com/records/arch/cdn-edge-caching.md), [Queuing Theory](https://banes-lab.com/records/arch/queuing-theory.md), [Consistency](https://banes-lab.com/records/arch/consistency.md), [Pessimistic Locking](https://banes-lab.com/records/arch/pessimistic-locking.md)

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

Violated by
response time above SLO

Detected by
trace span delays

Measured by
p50/p95/p99 latency

Refactored by
Cache, Async Offload, Optimize Query

Enforced by
SLO gates

Before

```typescript
async function renderFoo(id: FooId) {
const foo = await fooStore.find(id);
const bar = await barStore.find(foo.barId);
const baz = await bazStore.find(foo.bazId);
return render(foo, bar, baz);
}
```

After

```typescript
async function renderFoo(id: FooId) {
const foo = await fooStore.find(id);
const [bar, baz] = await Promise.all([
barStore.find(foo.barId),
bazStore.find(foo.bazId),
]);
return render(foo, bar, baz);
}
```

### Performance Engineering

- Kind: [activity](https://banes-lab.com/records/kind/activity.md)
- Severity: recommended
- Scope: codebase, service, system
- Layer: [Performance Core](https://banes-lab.com/records/layer/performance-core.md)

Details

Requires
[Profiling](https://banes-lab.com/records/arch/profiling.md), [Benchmarking](https://banes-lab.com/records/arch/benchmarking.md)

Reinforces
[Scalability](https://banes-lab.com/records/arch/scalability.md), [Resource Efficiency](https://banes-lab.com/records/lex/resource-efficiency.md)

Enables
[Evidence-Based Optimization](https://banes-lab.com/records/lex/evidence-based-optimization.md)

In tension with
[Maintainability](https://banes-lab.com/records/lex/maintainability.md)

Conflicts with
[Guess-Based Optimization](https://banes-lab.com/records/lex/guess-based-optimization.md)

Referenced by
[Scalability](https://banes-lab.com/records/arch/scalability.md), [Latency](https://banes-lab.com/records/arch/latency.md), [Optimization](https://banes-lab.com/records/arch/optimization.md), [Profiling](https://banes-lab.com/records/arch/profiling.md), [Benchmarking](https://banes-lab.com/records/arch/benchmarking.md), [Resource Utilization](https://banes-lab.com/records/arch/resource-utilization.md)

Tensions
[Performance Engineering Maintainability](https://banes-lab.com/records/tension/maintainability-performance-engineering.md)

Violated by
optimization without measurement

Detected by
performance changes lacking benchmark

Measured by
benchmark trend, SLO compliance

Refactored by
Profile, Optimize Bottleneck, Add Benchmark

Enforced by
performance CI

Before

```typescript
optimizeFooCode();
```

After

```typescript
const budget = { p95LatencyMs: 150, throughputPerSecond: 1000 } as const;
const profile = await measureFooWorkload(representativeLoad);
const change = optimize(profile.hotspot);
assertPerformance(change, budget);
```

### Algorithmic Efficiency

- Kind: [principle](https://banes-lab.com/records/kind/principle.md)
- Severity: contextual
- Scope: algorithm, data structure
- Layer: [Performance Core](https://banes-lab.com/records/layer/performance-core.md)

Details

Requires
[Complexity Awareness](https://banes-lab.com/records/lex/complexity-awareness.md)

Reinforces
[Scalability](https://banes-lab.com/records/arch/scalability.md)

Enables
[Efficient Processing](https://banes-lab.com/records/lex/efficient-processing.md)

In tension with
[Implementation Simplicity](https://banes-lab.com/records/lex/implementation-simplicity.md)

Conflicts with
[Inefficient Algorithm Choice](https://banes-lab.com/records/lex/inefficient-algorithm-choice.md), [N Plus One Query](https://banes-lab.com/records/arch/n-plus-one-query.md)

Referenced by
[Time Complexity](https://banes-lab.com/records/arch/time-complexity.md), [Big O Notation](https://banes-lab.com/records/arch/big-o-notation.md)

Tensions
[Algorithmic Efficiency Implementation Simplicity](https://banes-lab.com/records/tension/algorithmic-efficiency-implementation-simplicity.md)

Violated by
avoidable quadratic/exponential behavior

Detected by
complexity analysis, benchmark slope

Measured by
time/space complexity

Refactored by
Replace Algorithm, Add Index, Change Data Structure

Enforced by
[review](https://banes-lab.com/records/lex/review.md), benchmarks

Before

```typescript
function hasFoo(foos: Foo[], id: FooId) {
return foos.some(foo => foo.id === id);
}
```

After

```typescript
function indexFoos(foos: readonly Foo[]) {
return new Map(foos.map(foo => [foo.id, foo]));
}
const hasFoo = (index: ReadonlyMap<FooId, Foo>, id: FooId) => index.has(id);
```

### Time Complexity

- Kind: [metric](https://banes-lab.com/records/kind/metric.md)
- Severity: contextual
- Scope: algorithm, function
- Layer: [Performance Core](https://banes-lab.com/records/layer/performance-core.md)

Details

Requires
[Input Size Model](https://banes-lab.com/records/lex/input-size-model.md)

Reinforces
[Algorithmic Efficiency](https://banes-lab.com/records/arch/algorithmic-efficiency.md)

Enables
[Scalability Analysis](https://banes-lab.com/records/lex/scalability-analysis.md)

In tension with
[Space Complexity](https://banes-lab.com/records/arch/space-complexity.md)

Conflicts with
[Unbounded Runtime Growth](https://banes-lab.com/records/lex/unbounded-runtime-growth.md)

Referenced by
[Space Complexity](https://banes-lab.com/records/arch/space-complexity.md)

Tensions
[Time Complexity Space Complexity](https://banes-lab.com/records/tension/space-complexity-time-complexity.md)

Violated by
unacceptable asymptotic runtime

Detected by
nested loops over large inputs, benchmark slope

Measured by
Big O, runtime scaling

Refactored by
Improve Algorithm, Add Index/Cache

Enforced by
benchmark thresholds

Before

```typescript
function duplicateFooIds(foos: Foo[]) {
return foos.filter((foo, index) => foos.findIndex(x => x.id === foo.id) !== index);
}
```

After

```typescript
function duplicateFooIds(foos: readonly Foo[]) {
const seen = new Set<FooId>();
return foos.filter(foo => seen.has(foo.id) || !seen.add(foo.id));
}
```

### Space Complexity

- Kind: [metric](https://banes-lab.com/records/kind/metric.md)
- Severity: contextual
- Scope: algorithm, process
- Layer: [Performance Core](https://banes-lab.com/records/layer/performance-core.md)

Details

Requires
[Memory Model](https://banes-lab.com/records/lex/memory-model.md)

Reinforces
[Resource Utilization](https://banes-lab.com/records/arch/resource-utilization.md)

Enables
[Memory Scalability](https://banes-lab.com/records/lex/memory-scalability.md)

In tension with
[Time Complexity](https://banes-lab.com/records/arch/time-complexity.md)

Conflicts with
[Unbounded Memory Growth](https://banes-lab.com/records/lex/unbounded-memory-growth.md)

Referenced by
[Time Complexity](https://banes-lab.com/records/arch/time-complexity.md)

Tensions
[Space Complexity Time Complexity](https://banes-lab.com/records/tension/space-complexity-time-complexity.md)

Violated by
loading unbounded data into memory

Detected by
memory profiling, [full materialization](https://banes-lab.com/records/lex/full-materialization.md)

Measured by
Big O space, peak memory

Refactored by
Stream Data, Use Iterator, Chunk Processing

Enforced by
memory benchmarks

Before

```typescript
function processFoos(stream: AsyncIterable<Foo>) {
return collectAll(stream).then(foos => foos.map(transformFoo));
}
```

After

```typescript
async function* processFoos(stream: AsyncIterable<Foo>) {
for await (const foo of stream) yield transformFoo(foo);
}
```

### Big O Notation

- Kind: [technique](https://banes-lab.com/records/kind/technique.md)
- Severity: contextual
- Scope: algorithm
- Layer: [Performance Core](https://banes-lab.com/records/layer/performance-core.md)

Details

Requires
[Complexity Model](https://banes-lab.com/records/lex/complexity-model.md)

Reinforces
[Algorithmic Efficiency](https://banes-lab.com/records/arch/algorithmic-efficiency.md)

Enables
[Comparative Analysis](https://banes-lab.com/records/lex/comparative-analysis.md)

In tension with
[Constant-Factor Practicality](https://banes-lab.com/records/lex/constant-factor-practicality.md)

Conflicts with
[Anecdotal Performance Claims](https://banes-lab.com/records/lex/anecdotal-performance-claims.md)

Tensions
[Big O Notation Constant-Factor Practicality](https://banes-lab.com/records/tension/big-o-notation-constant-factor-practicality.md)

Violated by
ignoring growth behavior for large inputs

Detected by
missing complexity note for critical algorithm

Measured by
asymptotic classification

Refactored by
Analyze Complexity, Replace Algorithm

Enforced by
review checklist

Before

```typescript
function pairFoosWithBars(foos: Foo[], bars: Bar[]) {
return foos.flatMap(foo => bars.filter(bar => bar.fooId === foo.id).map(bar => [foo, bar]));
}
```

After

```typescript
function pairFoosWithBars(foos: readonly Foo[], bars: readonly Bar[]) {
const barsByFoo = groupBy(bars, bar => bar.fooId);
return foos.flatMap(foo => (barsByFoo.get(foo.id) ?? []).map(bar => [foo, bar]));
}
```

### Optimization

- Kind: [activity](https://banes-lab.com/records/kind/activity.md)
- Severity: contextual
- Scope: code, database, system
- Layer: [Performance Core](https://banes-lab.com/records/layer/performance-core.md)

Details

Requires
[Profiling](https://banes-lab.com/records/arch/profiling.md), [Bottleneck Evidence](https://banes-lab.com/records/lex/bottleneck-evidence.md)

Reinforces
[Performance Engineering](https://banes-lab.com/records/arch/performance-engineering.md)

Enables
[Resource Efficiency](https://banes-lab.com/records/lex/resource-efficiency.md)

In tension with
[Readability/Maintainability](https://banes-lab.com/records/lex/readability-maintainability.md)

Conflicts with
[Premature Optimization](https://banes-lab.com/records/lex/premature-optimization.md)

Referenced by
[Compile-Time Evaluation](https://banes-lab.com/records/arch/compile-time-evaluation.md), [Bottleneck Analysis](https://banes-lab.com/records/arch/bottleneck-analysis.md)

Tensions
[Optimization Readability/Maintainability](https://banes-lab.com/records/tension/optimization-readability-maintainability.md)

Violated by
optimizing without measured bottleneck

Detected by
complex code without performance evidence

Measured by
benchmark delta, SLO improvement

Refactored by
Optimize Bottleneck, Simplify After Optimization

Enforced by
benchmark review

Before

```typescript
const fooCache = new Map<FooId, Foo>();
function loadFoo(id: FooId) { return fooCache.get(id) ?? expensiveLoad(id); }
```

After

```typescript
const profile = profiler.measure("foo.load", representativeFooIds);
if (profile.hotspot === "foo-store-read") {
enableBoundedFooCache({ maxEntries: 10_000, ttlMs: 30_000 });
}
```

### Profiling

- Kind: [technique](https://banes-lab.com/records/kind/technique.md)
- Severity: recommended
- Scope: runtime, code path
- Layer: [Performance Core](https://banes-lab.com/records/layer/performance-core.md)

Details

Requires
[Representative Workload](https://banes-lab.com/records/lex/representative-workload.md)

Reinforces
[Performance Engineering](https://banes-lab.com/records/arch/performance-engineering.md)

Enables
[Bottleneck Detection](https://banes-lab.com/records/lex/bottleneck-detection.md)

In tension with
[Measurement Overhead](https://banes-lab.com/records/lex/measurement-overhead.md)

Conflicts with
[Guesswork](https://banes-lab.com/records/lex/guesswork.md)

Referenced by
[Performance Engineering](https://banes-lab.com/records/arch/performance-engineering.md), [Optimization](https://banes-lab.com/records/arch/optimization.md), [Bottleneck Analysis](https://banes-lab.com/records/arch/bottleneck-analysis.md)

Tensions
[Profiling Measurement Overhead](https://banes-lab.com/records/tension/measurement-overhead-profiling.md)

Violated by
performance decisions without profiling

Detected by
missing profile evidence

Measured by
hotspot attribution

Refactored by
Profile Path, Target Hotspot

Enforced by
performance review

Before

```typescript
rewriteFooParserForSpeed();
```

After

```typescript
const profile = await profiler.capture(() => parseFooBatch(batch));
const hotspot = profile.topFrame();
optimizeFooFrame(hotspot);
```

### Benchmarking

- Kind: [activity](https://banes-lab.com/records/kind/activity.md)
- Severity: recommended
- Scope: function, service, system
- Layer: [Performance Core](https://banes-lab.com/records/layer/performance-core.md)

Details

Requires
[Repeatable Test Environment](https://banes-lab.com/records/lex/repeatable-test-environment.md)

Reinforces
[Reproducibility](https://banes-lab.com/records/arch/reproducibility.md), [Performance Engineering](https://banes-lab.com/records/arch/performance-engineering.md)

Enables
[Regression Detection](https://banes-lab.com/records/lex/regression-detection.md)

In tension with
[Environment Drift](https://banes-lab.com/records/lex/environment-drift.md)

Conflicts with
[Anecdotal Timing](https://banes-lab.com/records/lex/anecdotal-timing.md)

Referenced by
[Performance Engineering](https://banes-lab.com/records/arch/performance-engineering.md)

Tensions
[Benchmarking Environment Drift](https://banes-lab.com/records/tension/benchmarking-environment-drift.md)

Violated by
performance claim without benchmark

Detected by
missing benchmark for perf-sensitive changes

Measured by
benchmark score/trend

Refactored by
Add Benchmark, Stabilize Environment

Enforced by
benchmark CI

Before

```typescript
const start = clock.now();
runFoo();
report(clock.now() - start);
```

After

```typescript
benchmark("foo.parse", {
warmup: 100,
iterations: 10_000,
run: () => parseFoo(fixture),
});
```

### Bottleneck Analysis

- Kind: [activity](https://banes-lab.com/records/kind/activity.md)
- Severity: recommended
- Scope: code path, system
- Layer: [Performance Core](https://banes-lab.com/records/layer/performance-core.md)

Details

Requires
[Profiling](https://banes-lab.com/records/arch/profiling.md), [Metrics](https://banes-lab.com/records/lex/metrics.md)

Reinforces
[Optimization](https://banes-lab.com/records/arch/optimization.md)

Enables
[Targeted Improvement](https://banes-lab.com/records/lex/targeted-improvement.md)

In tension with
[Distributed Complexity](https://banes-lab.com/records/lex/distributed-complexity.md)

Conflicts with
[Local Micro-Optimization](https://banes-lab.com/records/lex/local-micro-optimization.md)

Tensions
[Bottleneck Analysis Distributed Complexity](https://banes-lab.com/records/tension/bottleneck-analysis-distributed-complexity.md)

Violated by
optimizing non-bottleneck code

Detected by
performance work without hotspot evidence

Measured by
bottleneck contribution percentage

Refactored by
Remove Bottleneck, Parallelize, Cache

Enforced by
performance review

Before

```typescript
addMoreFooWorkers();
```

After

```typescript
const trace = await measureFooPipeline();
const bottleneck = trace.stages.sort((a, b) => b.waitMs - a.waitMs)[0];
removeBottleneck(bottleneck);
```

### Resource Utilization

- Kind: [metric](https://banes-lab.com/records/kind/metric.md)
- Severity: contextual
- Scope: CPU, memory, IO, network
- Layer: [Performance Core](https://banes-lab.com/records/layer/performance-core.md)

Details

Requires
[Monitoring](https://banes-lab.com/records/arch/monitoring.md)

Reinforces
[Performance Engineering](https://banes-lab.com/records/arch/performance-engineering.md)

Enables
[Capacity Planning](https://banes-lab.com/records/lex/capacity-planning.md)

In tension with
[Over-Provisioning](https://banes-lab.com/records/lex/over-provisioning.md)

Conflicts with
[Resource Waste/Saturation](https://banes-lab.com/records/lex/resource-waste-saturation.md)

Referenced by
[Bulkhead Pattern](https://banes-lab.com/records/arch/bulkhead-pattern.md), [Space Complexity](https://banes-lab.com/records/arch/space-complexity.md)

Tensions
[Resource Utilization Over-Provisioning](https://banes-lab.com/records/tension/over-provisioning-resource-utilization.md)

Violated by
persistent saturation or idle waste

Detected by
monitoring metrics

Measured by
CPU/memory/IO/network utilization

Refactored by
Optimize Resource Use, [Scale](https://banes-lab.com/records/reason/dimension-scale.md), Tune Config

Enforced by
SLO/capacity policy

Before

```typescript
deployFoo({ cpu: 16, memoryGb: 64 });
```

After

```typescript
const sizing = rightSizeFoo({
cpuP95: metrics.cpu("foo", "p95"),
memoryP95: metrics.memory("foo", "p95"),
headroom: 0.25,
});
deployFoo(sizing);
```

### Rate Limiting

- Kind: [mechanism](https://banes-lab.com/records/kind/mechanism.md)
- Severity: mandatory for public APIs
- Scope: API, service, queue
- Layer: [Performance Core](https://banes-lab.com/records/layer/performance-core.md)

Details

Requires
[Quota Policy](https://banes-lab.com/records/lex/quota-policy.md)

Reinforces
[Backpressure](https://banes-lab.com/records/arch/backpressure.md), [Security](https://banes-lab.com/records/lex/security.md)

Enables
[Abuse/Overload Protection](https://banes-lab.com/records/lex/abuse-overload-protection.md)

In tension with
[User Experience](https://banes-lab.com/records/lex/user-experience.md)

Conflicts with
[Unbounded Access](https://banes-lab.com/records/lex/unbounded-access.md)

Tensions
[Rate Limiting User Experience](https://banes-lab.com/records/tension/rate-limiting-user-experience.md)

Violated by
unlimited calls to constrained resource

Detected by
missing rate limiter on public/expensive endpoints

Measured by
limit hit rate, overload incidents

Refactored by
Add Rate Limiter, Define Quotas

Enforced by
API gateway/policy

Before

```typescript
app.post("/foo", createFoo);
```

After

```typescript
app.post("/foo", rateLimit({
key: request => request.identity.id,
limit: 100,
windowMs: 60_000,
}), createFoo);
```

### Memory Efficiency

- Kind: [quality-attribute](https://banes-lab.com/records/kind/quality-attribute.md)
- Severity: contextual
- Scope: algorithm, process, stream
- Layer: [Performance Core](https://banes-lab.com/records/layer/performance-core.md)

Details

Requires
[Space Complexity Awareness](https://banes-lab.com/records/lex/space-complexity-awareness.md)

Reinforces
[Scalability](https://banes-lab.com/records/arch/scalability.md)

Enables
[Large Input Handling](https://banes-lab.com/records/lex/large-input-handling.md)

In tension with
[CPU Cost](https://banes-lab.com/records/lex/cpu-cost.md)

Conflicts with
[Full Materialization](https://banes-lab.com/records/lex/full-materialization.md)

Referenced by
[Single-Pass Processing](https://banes-lab.com/records/arch/single-pass-processing.md), [Lazy Evaluation](https://banes-lab.com/records/arch/lazy-evaluation.md), [Sequential Access](https://banes-lab.com/records/arch/sequential-access.md), [Flyweight Pattern](https://banes-lab.com/records/arch/flyweight-pattern.md)

Tensions
[Memory Efficiency CPU Cost](https://banes-lab.com/records/tension/cpu-cost-memory-efficiency.md)

Violated by
loading unbounded data into memory

Detected by
memory profile spikes

Measured by
peak memory, allocation rate

Refactored by
Stream, Chunk, Use Iterator

Enforced by
memory benchmarks

Before

```typescript
const copies = foos.map(foo => structuredClone(foo));
```

After

```typescript
function* fooViews(foos: readonly Foo[]) {
for (const foo of foos) yield { id: foo.id, name: foo.name };
}
```

### CDN / Edge Caching

- Kind: [mechanism](https://banes-lab.com/records/kind/mechanism.md)
- Severity: contextual
- Scope: service, infrastructure, latency
- Layer: [Performance Core](https://banes-lab.com/records/layer/performance-core.md)

Details

Requires
[Cacheable Content](https://banes-lab.com/records/lex/cacheable-content.md)

Reinforces
[Caching](https://banes-lab.com/records/arch/caching.md), [Latency](https://banes-lab.com/records/arch/latency.md)

Enables
[Origin Offload](https://banes-lab.com/records/lex/origin-offload.md), [Geographically-Local Delivery](https://banes-lab.com/records/lex/geographically-local-delivery.md)

In tension with
[Cache Invalidation](https://banes-lab.com/records/lex/cache-invalidation.md)

Conflicts with
[Origin-Only Serving](https://banes-lab.com/records/lex/origin-only-serving.md)

Tensions
[CDN / Edge Caching Cache Invalidation](https://banes-lab.com/records/tension/cache-invalidation-cdn-edge-caching.md)

Violated by
every request hitting the origin regardless of locality

Detected by
static assets served from origin per request

Measured by
origin request rate / cache hit ratio

Refactored by
Serve via CDN / Edge Cache

Enforced by
performance review

Before

```typescript
app.get("/foo/:id/avatar", serveFooAvatarFromOrigin);
```

After

```typescript
app.get("/foo/:id/avatar",
edgeCache({ ttl: "7d", key: request => request.params.id }),
serveFooAvatarFromOrigin,
);
```

### Read Replica

- Kind: [technique](https://banes-lab.com/records/kind/technique.md)
- Severity: contextual
- Scope: service, database, scalability
- Layer: [Performance Core](https://banes-lab.com/records/layer/performance-core.md)

Details

Requires
[Replication](https://banes-lab.com/records/arch/replication.md)

Reinforces
[Horizontal Scaling](https://banes-lab.com/records/arch/horizontal-scaling.md), [Load Balancing](https://banes-lab.com/records/arch/load-balancing.md)

Enables
[Read Traffic Offload](https://banes-lab.com/records/lex/read-traffic-offload.md)

In tension with
[Read-Your-Writes Consistency](https://banes-lab.com/records/lex/read-your-writes-consistency.md)

Conflicts with
[Single-Primary Read Contention](https://banes-lab.com/records/lex/single-primary-read-contention.md)

Tensions
[Read Replica Read-Your-Writes Consistency](https://banes-lab.com/records/tension/read-replica-read-your-writes-consistency.md)

Violated by
all reads and writes hitting one primary

Detected by
read load saturating the write primary

Measured by
primary read/write contention ratio

Refactored by
Route Reads to Replicas

Enforced by
database design review

Before

```typescript
const foo = await primaryDb.query(fooQuery);
await primaryDb.write(fooCommand);
```

After

```typescript
const foo = await replicaRouter.read(fooQuery);
await primaryDb.write(fooCommand);
```

### Queuing Theory

- Kind: [model](https://banes-lab.com/records/kind/model.md)
- Severity: contextual
- Scope: performance, capacity, system
- Layer: [Performance Core](https://banes-lab.com/records/layer/performance-core.md)

Details

Requires
[Arrival and Service Rates](https://banes-lab.com/records/lex/arrival-and-service-rates.md)

Reinforces
[Capacity Planning](https://banes-lab.com/records/lex/capacity-planning.md), [Latency](https://banes-lab.com/records/arch/latency.md)

Enables
[Wait-Time Prediction](https://banes-lab.com/records/lex/wait-time-prediction.md), [Utilization-Based Sizing](https://banes-lab.com/records/lex/utilization-based-sizing.md)

In tension with
[Model Assumptions](https://banes-lab.com/records/lex/model-assumptions.md)

Conflicts with
[Guess-Based Capacity](https://banes-lab.com/records/lex/guess-based-capacity.md)

Contracts
[Queuing Theory](https://banes-lab.com/records/algo/queuing-theory.md)

Tensions
[Queuing Theory Model Assumptions](https://banes-lab.com/records/tension/model-assumptions-queuing-theory.md)

Violated by
worker pool sized by guesswork with no arrival/service-rate model

Detected by
latency collapsing as utilization approaches saturation

Measured by
predicted vs actual queue depth and wait time

Refactored by
Size the system from an M/M/1 (or M/M/c) queuing model

Enforced by
capacity review

Before

```typescript
const workers = 4;
```

After

```typescript
const rho = arrivalRate / (workers * serviceRate);
if (rho >= 1) throw new Error("unstable queue: utilization >= 1");
const avgWaitMs = mm1WaitTime({ arrivalRate, serviceRate, servers: workers });
```

## Links to

- [quality-attribute](https://banes-lab.com/records/kind/quality-attribute.md)
- [Performance Core](https://banes-lab.com/records/layer/performance-core.md)
- [Load Model](https://banes-lab.com/records/lex/load-model.md)
- [Bottleneck Awareness](https://banes-lab.com/records/lex/bottleneck-awareness.md)
- [Performance Engineering](https://banes-lab.com/records/arch/performance-engineering.md)
- [Growth Handling](https://banes-lab.com/records/lex/growth-handling.md)
- [Simplicity](https://banes-lab.com/records/lex/simplicity.md)
- [Consistency](https://banes-lab.com/records/arch/consistency.md)
- [Fixed-Capacity Design](https://banes-lab.com/records/lex/fixed-capacity-design.md)
- [Microservices](https://banes-lab.com/records/arch/microservices.md)
- [Message Broker](https://banes-lab.com/records/arch/message-broker.md)
- [CQRS](https://banes-lab.com/records/arch/command-query-responsibility-segregation.md)
- [Eventual Consistency](https://banes-lab.com/records/arch/eventual-consistency.md)
- [Service Discovery](https://banes-lab.com/records/arch/service-discovery.md)
- [Elasticity](https://banes-lab.com/records/arch/elasticity.md)
- [Load Balancing](https://banes-lab.com/records/arch/load-balancing.md)
- [Partitioning](https://banes-lab.com/records/arch/partitioning.md)
- [Caching](https://banes-lab.com/records/arch/caching.md)
- [Throughput](https://banes-lab.com/records/arch/throughput.md)
- [Algorithmic Efficiency](https://banes-lab.com/records/arch/algorithmic-efficiency.md)
- [Memory Efficiency](https://banes-lab.com/records/arch/memory-efficiency.md)
- [Replication](https://banes-lab.com/records/arch/replication.md)
- [Stateless Processing](https://banes-lab.com/records/arch/stateless-processing.md)
- [Scalability / Simplicity](https://banes-lab.com/records/tension/scalability-simplicity.md)
- [Scalability / Consistency](https://banes-lab.com/records/tension/consistency-scalability.md)
- [technique](https://banes-lab.com/records/kind/technique.md)
- [Statelessness or Shared State Strategy](https://banes-lab.com/records/lex/statelessness-or-shared-state-strategy.md)
- [Availability](https://banes-lab.com/records/lex/availability.md)
- [Scale-Out](https://banes-lab.com/records/lex/scale-out.md)
- [Distributed Coordination](https://banes-lab.com/records/lex/distributed-coordination.md)
- [Instance-Local State](https://banes-lab.com/records/lex/instance-local-state.md)
- [Space-Based Architecture](https://banes-lab.com/records/arch/space-based-architecture.md)
- [Competing Consumers](https://banes-lab.com/records/arch/competing-consumers.md)
- [Sharding](https://banes-lab.com/records/arch/sharding.md)
- [Statelessness](https://banes-lab.com/records/arch/statelessness.md)
- [Read Replica](https://banes-lab.com/records/arch/read-replica.md)
- [Horizontal Scaling / Distributed Coordination](https://banes-lab.com/records/tension/distributed-coordination-horizontal-scaling.md)
- [Resource Headroom](https://banes-lab.com/records/lex/resource-headroom.md)
- [Capacity Increase without Distribution](https://banes-lab.com/records/lex/capacity-increase-without-distribution.md)
- [Cost/Limit](https://banes-lab.com/records/lex/cost-limit.md)
- [Hard Resource Ceiling](https://banes-lab.com/records/lex/hard-resource-ceiling.md)
- [Vertical Scaling / Cost/Limit](https://banes-lab.com/records/tension/cost-limit-vertical-scaling.md)
- [Capacity Planning](https://banes-lab.com/records/lex/capacity-planning.md)
- [Auto-Scaling](https://banes-lab.com/records/arch/auto-scaling.md)
- [Metrics](https://banes-lab.com/records/lex/metrics.md)
- [Scalability](https://banes-lab.com/records/arch/scalability.md)
- [Cost Efficiency](https://banes-lab.com/records/lex/cost-efficiency.md)
- [Dynamic Capacity](https://banes-lab.com/records/lex/dynamic-capacity.md)
- [Warm-Up Latency](https://banes-lab.com/records/lex/warm-up-latency.md)
- [Fixed Provisioning](https://banes-lab.com/records/lex/fixed-provisioning.md)
- [Horizontal Scaling](https://banes-lab.com/records/arch/horizontal-scaling.md)
- [Elasticity / Warm-Up Latency](https://banes-lab.com/records/tension/elasticity-warm-up-latency.md)
- [mechanism](https://banes-lab.com/records/kind/mechanism.md)
- [Multiple Targets](https://banes-lab.com/records/lex/multiple-targets.md)
- [Health Checks](https://banes-lab.com/records/arch/health-checks.md)
- [Traffic Distribution](https://banes-lab.com/records/lex/traffic-distribution.md)
- [Session Affinity](https://banes-lab.com/records/lex/session-affinity.md)
- [Single Target Routing](https://banes-lab.com/records/lex/single-target-routing.md)
- [Load Balancing / Session Affinity](https://banes-lab.com/records/tension/load-balancing-session-affinity.md)
- [Latency](https://banes-lab.com/records/arch/latency.md)
- [pattern](https://banes-lab.com/records/kind/pattern.md)
- [Partition Key](https://banes-lab.com/records/lex/partition-key.md)
- [Large Dataset Scaling](https://banes-lab.com/records/lex/large-dataset-scaling.md)
- [Cross-Shard Queries](https://banes-lab.com/records/lex/cross-shard-queries.md)
- [Single Monolithic Store](https://banes-lab.com/records/lex/single-monolithic-store.md)
- [Sharding / Cross-Shard Queries](https://banes-lab.com/records/tension/cross-shard-queries-sharding.md)
- [Partition Strategy](https://banes-lab.com/records/lex/partition-strategy.md)
- [Isolation](https://banes-lab.com/records/arch/isolation.md)
- [Parallelism](https://banes-lab.com/records/arch/parallelism.md)
- [Rebalancing Complexity](https://banes-lab.com/records/lex/rebalancing-complexity.md)
- [Global Shared State](https://banes-lab.com/records/lex/global-shared-state.md)
- [Partitioning / Rebalancing Complexity](https://banes-lab.com/records/tension/partitioning-rebalancing-complexity.md)
- [Architecture Review](https://banes-lab.com/records/arch/architecture-review.md)
- [Invalidation Policy](https://banes-lab.com/records/lex/invalidation-policy.md)
- [Latency Reduction](https://banes-lab.com/records/lex/latency-reduction.md)
- [Reduced Load](https://banes-lab.com/records/lex/reduced-load.md)
- [Always-Fresh Reads](https://banes-lab.com/records/lex/always-fresh-reads.md)
- [Cache Poisoning by Design](https://banes-lab.com/records/arch/cache-poisoning-by-design.md)
- [CDN / Edge Caching](https://banes-lab.com/records/arch/cdn-edge-caching.md)
- [Caching / Consistency](https://banes-lab.com/records/tension/caching-consistency.md)
- [Caching / Always-Fresh Reads](https://banes-lab.com/records/tension/always-fresh-reads-caching.md)
- [principle](https://banes-lab.com/records/kind/principle.md)
- [Externalized State](https://banes-lab.com/records/lex/externalized-state.md)
- [Resilience](https://banes-lab.com/records/arch/resilience.md)
- [State Access Latency](https://banes-lab.com/records/lex/state-access-latency.md)
- [Instance Affinity](https://banes-lab.com/records/lex/instance-affinity.md)
- [Temporal Coupling](https://banes-lab.com/records/arch/temporal-coupling.md)
- [Statelessness / State Access Latency](https://banes-lab.com/records/tension/state-access-latency-statelessness.md)
- [model](https://banes-lab.com/records/kind/model.md)
- [Concurrency Control](https://banes-lab.com/records/arch/concurrency-control.md)
- [Overlapping Work](https://banes-lab.com/records/lex/overlapping-work.md)
- [Complexity](https://banes-lab.com/records/lex/complexity.md)
- [Race Conditions](https://banes-lab.com/records/lex/race-conditions.md)
- [Concurrency / Complexity](https://banes-lab.com/records/tension/complexity-concurrency.md)
- [Tests](https://banes-lab.com/records/lex/tests.md)
- [Independent Work Units](https://banes-lab.com/records/lex/independent-work-units.md)
- [Performance](https://banes-lab.com/records/lex/performance.md)
- [Multi-Core Utilization](https://banes-lab.com/records/lex/multi-core-utilization.md)
- [Coordination Overhead](https://banes-lab.com/records/lex/coordination-overhead.md)
- [Sequential Bottleneck](https://banes-lab.com/records/lex/sequential-bottleneck.md)
- [Causality](https://banes-lab.com/records/arch/causality.md)
- [Fan-out/Fan-in](https://banes-lab.com/records/arch/fan-out-fan-in.md)
- [Parallelism / Coordination Overhead](https://banes-lab.com/records/tension/coordination-overhead-parallelism.md)
- [metric](https://banes-lab.com/records/kind/metric.md)
- [Capacity Model](https://banes-lab.com/records/lex/capacity-model.md)
- [Load Handling](https://banes-lab.com/records/lex/load-handling.md)
- [Bottlenecks](https://banes-lab.com/records/lex/bottlenecks.md)
- [Code Review](https://banes-lab.com/records/arch/code-review.md)
- [Event Ordering](https://banes-lab.com/records/arch/event-ordering.md)
- [PACELC Theorem](https://banes-lab.com/records/arch/pacelc-theorem.md)
- [Backpressure](https://banes-lab.com/records/arch/backpressure.md)
- [Concurrency](https://banes-lab.com/records/arch/concurrency.md)
- [Throughput / Latency](https://banes-lab.com/records/tension/latency-throughput.md)
- [Time Budget](https://banes-lab.com/records/lex/time-budget.md)
- [User Experience](https://banes-lab.com/records/lex/user-experience.md)
- [Responsiveness](https://banes-lab.com/records/lex/responsiveness.md)
- [Throughput/Batching](https://banes-lab.com/records/lex/throughput-batching.md)
- [Long Blocking Work](https://banes-lab.com/records/lex/long-blocking-work.md)
- [Total-Order Broadcast](https://banes-lab.com/records/arch/total-order-broadcast.md)
- [CAP Theorem](https://banes-lab.com/records/arch/cap-theorem.md)
- [Consensus](https://banes-lab.com/records/arch/consensus.md)
- [Message Queue](https://banes-lab.com/records/arch/message-queue.md)
- [Queuing Theory](https://banes-lab.com/records/arch/queuing-theory.md)
- [Pessimistic Locking](https://banes-lab.com/records/arch/pessimistic-locking.md)
- [Latency / Throughput/Batching](https://banes-lab.com/records/tension/latency-throughput-batching.md)
- [activity](https://banes-lab.com/records/kind/activity.md)
- [Profiling](https://banes-lab.com/records/arch/profiling.md)
- [Benchmarking](https://banes-lab.com/records/arch/benchmarking.md)
- [Resource Efficiency](https://banes-lab.com/records/lex/resource-efficiency.md)
- [Evidence-Based Optimization](https://banes-lab.com/records/lex/evidence-based-optimization.md)
- [Maintainability](https://banes-lab.com/records/lex/maintainability.md)
- [Guess-Based Optimization](https://banes-lab.com/records/lex/guess-based-optimization.md)
- [Optimization](https://banes-lab.com/records/arch/optimization.md)
- [Resource Utilization](https://banes-lab.com/records/arch/resource-utilization.md)
- [Performance Engineering / Maintainability](https://banes-lab.com/records/tension/maintainability-performance-engineering.md)
- [Complexity Awareness](https://banes-lab.com/records/lex/complexity-awareness.md)
- [Efficient Processing](https://banes-lab.com/records/lex/efficient-processing.md)
- [Implementation Simplicity](https://banes-lab.com/records/lex/implementation-simplicity.md)
- [Inefficient Algorithm Choice](https://banes-lab.com/records/lex/inefficient-algorithm-choice.md)
- [N Plus One Query](https://banes-lab.com/records/arch/n-plus-one-query.md)
- [Time Complexity](https://banes-lab.com/records/arch/time-complexity.md)
- [Big O Notation](https://banes-lab.com/records/arch/big-o-notation.md)
- [Algorithmic Efficiency / Implementation Simplicity](https://banes-lab.com/records/tension/algorithmic-efficiency-implementation-simplicity.md)
- [Review](https://banes-lab.com/records/lex/review.md)
- [Input Size Model](https://banes-lab.com/records/lex/input-size-model.md)
- [Scalability Analysis](https://banes-lab.com/records/lex/scalability-analysis.md)
- [Space Complexity](https://banes-lab.com/records/arch/space-complexity.md)
- [Unbounded Runtime Growth](https://banes-lab.com/records/lex/unbounded-runtime-growth.md)
- [Time Complexity / Space Complexity](https://banes-lab.com/records/tension/space-complexity-time-complexity.md)
- [Memory Model](https://banes-lab.com/records/lex/memory-model.md)
- [Memory Scalability](https://banes-lab.com/records/lex/memory-scalability.md)
- [Unbounded Memory Growth](https://banes-lab.com/records/lex/unbounded-memory-growth.md)
- [Full Materialization](https://banes-lab.com/records/lex/full-materialization.md)
- [Complexity Model](https://banes-lab.com/records/lex/complexity-model.md)
- [Comparative Analysis](https://banes-lab.com/records/lex/comparative-analysis.md)
- [Constant-Factor Practicality](https://banes-lab.com/records/lex/constant-factor-practicality.md)
- [Anecdotal Performance Claims](https://banes-lab.com/records/lex/anecdotal-performance-claims.md)
- [Big O Notation / Constant-Factor Practicality](https://banes-lab.com/records/tension/big-o-notation-constant-factor-practicality.md)
- [Bottleneck Evidence](https://banes-lab.com/records/lex/bottleneck-evidence.md)
- [Readability/Maintainability](https://banes-lab.com/records/lex/readability-maintainability.md)
- [Premature Optimization](https://banes-lab.com/records/lex/premature-optimization.md)
- [Compile-Time Evaluation](https://banes-lab.com/records/arch/compile-time-evaluation.md)
- [Bottleneck Analysis](https://banes-lab.com/records/arch/bottleneck-analysis.md)
- [Optimization / Readability/Maintainability](https://banes-lab.com/records/tension/optimization-readability-maintainability.md)
- [Representative Workload](https://banes-lab.com/records/lex/representative-workload.md)
- [Bottleneck Detection](https://banes-lab.com/records/lex/bottleneck-detection.md)
- [Measurement Overhead](https://banes-lab.com/records/lex/measurement-overhead.md)
- [Guesswork](https://banes-lab.com/records/lex/guesswork.md)
- [Profiling / Measurement Overhead](https://banes-lab.com/records/tension/measurement-overhead-profiling.md)
- [Repeatable Test Environment](https://banes-lab.com/records/lex/repeatable-test-environment.md)
- [Reproducibility](https://banes-lab.com/records/arch/reproducibility.md)
- [Regression Detection](https://banes-lab.com/records/lex/regression-detection.md)
- [Environment Drift](https://banes-lab.com/records/lex/environment-drift.md)
- [Anecdotal Timing](https://banes-lab.com/records/lex/anecdotal-timing.md)
- [Benchmarking / Environment Drift](https://banes-lab.com/records/tension/benchmarking-environment-drift.md)
- [Targeted Improvement](https://banes-lab.com/records/lex/targeted-improvement.md)
- [Distributed Complexity](https://banes-lab.com/records/lex/distributed-complexity.md)
- [Local Micro-Optimization](https://banes-lab.com/records/lex/local-micro-optimization.md)
- [Bottleneck Analysis / Distributed Complexity](https://banes-lab.com/records/tension/bottleneck-analysis-distributed-complexity.md)
- [Monitoring](https://banes-lab.com/records/arch/monitoring.md)
- [Over-Provisioning](https://banes-lab.com/records/lex/over-provisioning.md)
- [Resource Waste/Saturation](https://banes-lab.com/records/lex/resource-waste-saturation.md)
- [Bulkhead Pattern](https://banes-lab.com/records/arch/bulkhead-pattern.md)
- [Resource Utilization / Over-Provisioning](https://banes-lab.com/records/tension/over-provisioning-resource-utilization.md)
- [Scale](https://banes-lab.com/records/reason/dimension-scale.md)
- [Quota Policy](https://banes-lab.com/records/lex/quota-policy.md)
- [Security](https://banes-lab.com/records/lex/security.md)
- [Abuse/Overload Protection](https://banes-lab.com/records/lex/abuse-overload-protection.md)
- [Unbounded Access](https://banes-lab.com/records/lex/unbounded-access.md)
- [Rate Limiting / User Experience](https://banes-lab.com/records/tension/rate-limiting-user-experience.md)
- [Space Complexity Awareness](https://banes-lab.com/records/lex/space-complexity-awareness.md)
- [Large Input Handling](https://banes-lab.com/records/lex/large-input-handling.md)
- [CPU Cost](https://banes-lab.com/records/lex/cpu-cost.md)
- [Single-Pass Processing](https://banes-lab.com/records/arch/single-pass-processing.md)
- [Lazy Evaluation](https://banes-lab.com/records/arch/lazy-evaluation.md)
- [Sequential Access](https://banes-lab.com/records/arch/sequential-access.md)
- [Flyweight Pattern](https://banes-lab.com/records/arch/flyweight-pattern.md)
- [Memory Efficiency / CPU Cost](https://banes-lab.com/records/tension/cpu-cost-memory-efficiency.md)
- [Cacheable Content](https://banes-lab.com/records/lex/cacheable-content.md)
- [Origin Offload](https://banes-lab.com/records/lex/origin-offload.md)
- [Geographically-Local Delivery](https://banes-lab.com/records/lex/geographically-local-delivery.md)
- [Cache Invalidation](https://banes-lab.com/records/lex/cache-invalidation.md)
- [Origin-Only Serving](https://banes-lab.com/records/lex/origin-only-serving.md)
- [CDN / Edge Caching / Cache Invalidation](https://banes-lab.com/records/tension/cache-invalidation-cdn-edge-caching.md)
- [Read Traffic Offload](https://banes-lab.com/records/lex/read-traffic-offload.md)
- [Read-Your-Writes Consistency](https://banes-lab.com/records/lex/read-your-writes-consistency.md)
- [Single-Primary Read Contention](https://banes-lab.com/records/lex/single-primary-read-contention.md)
- [Read Replica / Read-Your-Writes Consistency](https://banes-lab.com/records/tension/read-replica-read-your-writes-consistency.md)
- [Arrival and Service Rates](https://banes-lab.com/records/lex/arrival-and-service-rates.md)
- [Wait-Time Prediction](https://banes-lab.com/records/lex/wait-time-prediction.md)
- [Utilization-Based Sizing](https://banes-lab.com/records/lex/utilization-based-sizing.md)
- [Model Assumptions](https://banes-lab.com/records/lex/model-assumptions.md)
- [Guess-Based Capacity](https://banes-lab.com/records/lex/guess-based-capacity.md)
- [Queuing Theory](https://banes-lab.com/records/algo/queuing-theory.md)
- [Queuing Theory / Model Assumptions](https://banes-lab.com/records/tension/model-assumptions-queuing-theory.md)

## Linked from

- [The layer topology](https://banes-lab.com/ontology/schema/the-layer-topology.md)
- [The membership](https://banes-lab.com/ontology/schema/the-membership.md)
