Skip to main content
ARCHOS 525 BLUEPRINT · /d/dgm_code-lru-lfu-implementation

LRU & LFU Cache Internals (Hash Map + Doubly Linked List / W-TinyLFU)

6 COMPONENTS · 6 FLOWS · UPDATED 2026-11-24
GITHUB README / PR PREVIEW CARD
[![LRU & LFU Cache Internals (Hash Map + Doubly Linked List / W-TinyLFU) — ArchOS Architecture](https://archos.sageideas.dev/d/dgm_code-lru-lfu-implementation/opengraph-image)](https://archos.sageideas.dev/d/dgm_code-lru-lfu-implementation)

*Interactive architecture diagram powered by [ArchOS Studio](https://archos.sageideas.dev/d/dgm_code-lru-lfu-implementation)*
NOTION / DOCS / CONFLUENCE EMBED
<iframe src="https://archos.sageideas.dev/embed/dgm_code-lru-lfu-implementation" width="100%" height="580" style="border:1px solid rgba(240,236,225,0.14);border-radius:6px;" loading="lazy" title="LRU & LFU Cache Internals (Hash Map + Doubly Linked List / W-TinyLFU) — Interactive in ArchOS"></iframe>
PORTABLE MERMAID SPEC (GITHUB / NOTION / RFC)
flowchart LR
  client_0["Cache Caller"]
  n1_1[("Hash Table Index")]
  n2a_2[("LRU Doubly-Linked List")]
  n2b_3[("W-TinyLFU Sketch")]
  n3_4[("Bounded Value Arena")]
  downstream_5["Downstream & OTel"]
  client_0 -->|"1. Lookup O · HashMap"| n1_1
  n1_1 -->|"2a. Promote O · DLL"| n2a_2
  n1_1 -->|"2b. Admit test · CMS"| n2b_3
  n2a_2 -->|"3a. Read/Evict · RAM"| n3_4
  n2b_3 -->|"3b. Merge · RAM"| n3_4
  n3_4 -.->|"4. Emit / · OTLP/API"| downstream_5

COMPONENT STACK (6)

  • Cache CallerSTATELESS
    get / put
  • Hash Table IndexSTATEFUL
    O key -> node pointer
  • LRU Doubly-Linked ListSTATEFUL
    Move-to-head + tail eviction
  • W-TinyLFU SketchSTATEFUL
    Count-Min Sketch frequency filter
  • Bounded Value ArenaSTATEFUL
    Strict byte/entry cap + TTL
  • Downstream & OTelSTATELESS
    Consumers, metrics & SLOs

REQUEST & DATA FLOW (6)

  1. Cache Caller → Hash Table Index (Lookup O)[HashMap]
  2. Hash Table Index → LRU Doubly-Linked List (Promote O)[DLL]
  3. Hash Table Index → W-TinyLFU Sketch (Admit test)[CMS]
  4. LRU Doubly-Linked List → Bounded Value Arena (Read/Evict)[RAM]
  5. W-TinyLFU Sketch → Bounded Value Arena (Merge)[RAM]
  6. Bounded Value Arena → Downstream & OTel (Emit /)[OTLP/API]
Configure NGINX / Postgres / K8s →60-Sec L4–L7 Diagnostic →