← ClaudeAtlas

caching-and-system-tradeoffslisted

Caching and systems-design trade-offs backed by numbers: cache patterns, eviction (LRU, LFU, ARC, W-TinyLFU, SIEVE, S3-FIFO), hit-ratio math and miss-ratio curves, TTL and invalidation, stampede protection, cache consistency races, partitioning (consistent, rendezvous, jump, Maglev hashing), fan-out tail latency, queueing and utilisation, and ADRs. Load when adding or debugging a cache or justifying a design trade-off quantitatively.
rustcircle/c101 · ★ 0 · AI & Automation · score 65
Install: claude install-skill rustcircle/c101
# Caching and system trade-offs Quantitative design: state the workload, compute, then choose. Latency constants and benchmarking method live in `performance-optimization`; timeouts, retries with jitter, breakers and rate limits in `resilience-patterns`; replication guarantees in `distributed-consensus-consistency`; database-side concurrency in `database-transactions-isolation`; ADR format in `docs-and-adr-writing`. ## 1. Frame the trade-off - Axes: latency (p50 and p99), throughput, consistency (maximum staleness), cost, durability, availability, operability (failure modes, on-call load). - Workload: read/write ratio, number of keys N, popularity skew (fit Zipf s from the log-log rank-frequency slope of an access log), object size distribution, peak QPS, update rate, and the staleness each endpoint tolerates. - SLOs the design must meet, per endpoint. - Write every decision as "accept X to gain Y, measured by Z", and note whether it is reversible and at what cost. ## 2. Back-of-envelope procedure | Quantity | Formula | Example | |---|---|---| | Bandwidth | QPS x object size | 20k/s x 4 KB = 80 MB/s, about 640 Mbit/s | | Working set | distinct keys per window x size | 200k x 4 KB = 0.8 GB | | Concurrency (Little's law) | L = lambda x W | 20k/s x 50 ms = 1,000 requests in flight | | Queueing (M/M/1) | W = S / (1 - rho), rho = lambda / mu | rho 0.5: 2S; 0.7: 3.3S; 0.8: 5S; 0.9: 10S; 0.95: 20S | | Fan-out tail | P(some call slow) = 1 - p^n | 100 calls at p99: 1 - 0.