Skip to content

Enterprise 3-Tier Caching for Node.js

L1 RAM → L1.5 Off-Heap (/dev/shm) → L2 Redis/Valkey. Delivering 2.81M ops/sec warm reads with zero stampedes.

Architectural Topology

TriCache Multi-Tier Architectural Topology
View as ASCII Architecture Spec
                           [Incoming Read Request]
                                      │
                                      ▼
             ┌──────────────────────────────────────────────────┐
             │       L1: Smart Memory (W-TinyLFU + CMS)         │  ~350 ns (2.81M ops/s)
             │   Window LRU (1%) + Segmented Main SLRU (99%)    │  Zero V8 allocation
             └────────────────────────┬─────────────────────────┘
                                      │ Miss / Eviction Spill
                                      ▼
             ┌──────────────────────────────────────────────────┐
             │    L1.5: Off-Heap /dev/shm & NVMe Spill Tier     │  ~20 µs (RAM speed)
             │   POSIX tmpfs bypasses V8 GC & cloud EBS IOPS    │  readOnlyRootFilesystem
             └────────────────────────┬─────────────────────────┘
                                      │ Miss
                                      ▼
             ┌──────────────────────────────────────────────────┐
             │       L2: Redis / Valkey Distributed Tier        │  ~1.2 ms (Network)
             │   AES-256-GCM AEAD at-rest + msgpackr records    │  Pipelined MGET/MSET
             └────────────────────────┬─────────────────────────┘
                                      │ Complete Cache Miss
                                      ▼
             ┌──────────────────────────────────────────────────┐
             │   Upstream Database / API (Singleflight Lock)    │  Exactly 1 execution
             │   Inflight Promise Map coalesces 10,000 callers  │  Zero stampedes
             └──────────────────────────────────────────────────┘

Community & Ecosystem

First-class drivers and turnkey adapters built for zero serialization overhead across modern runtimes.