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
[](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_5COMPONENT STACK (6)
- Cache CallerSTATELESSget / put
- Hash Table IndexSTATEFULO key -> node pointer
- LRU Doubly-Linked ListSTATEFULMove-to-head + tail eviction
- W-TinyLFU SketchSTATEFULCount-Min Sketch frequency filter
- Bounded Value ArenaSTATEFULStrict byte/entry cap + TTL
- Downstream & OTelSTATELESSConsumers, metrics & SLOs
REQUEST & DATA FLOW (6)
- Cache Caller → Hash Table Index (Lookup O)[HashMap]
- Hash Table Index → LRU Doubly-Linked List (Promote O)[DLL]
- Hash Table Index → W-TinyLFU Sketch (Admit test)[CMS]
- LRU Doubly-Linked List → Bounded Value Arena (Read/Evict)[RAM]
- W-TinyLFU Sketch → Bounded Value Arena (Merge)[RAM]
- Bounded Value Arena → Downstream & OTel (Emit /)[OTLP/API]