Skip to main content
ARCHOS 525 BLUEPRINT · /d/dgm_int-redis

Redis Internals (Event Loop, In-Memory Structures & RDB/AOF)

8 COMPONENTS · 7 FLOWS · UPDATED 2026-11-24
GITHUB README / PR PREVIEW CARD
[![Redis Internals (Event Loop, In-Memory Structures & RDB/AOF) — ArchOS Architecture](https://archos.sageideas.dev/d/dgm_int-redis/opengraph-image)](https://archos.sageideas.dev/d/dgm_int-redis)

*Interactive architecture diagram powered by [ArchOS Studio](https://archos.sageideas.dev/d/dgm_int-redis)*
NOTION / DOCS / CONFLUENCE EMBED
<iframe src="https://archos.sageideas.dev/embed/dgm_int-redis" width="100%" height="580" style="border:1px solid rgba(240,236,225,0.14);border-radius:6px;" loading="lazy" title="Redis Internals (Event Loop, In-Memory Structures & RDB/AOF) — Interactive in ArchOS"></iframe>
PORTABLE MERMAID SPEC (GITHUB / NOTION / RFC)
flowchart LR
  client_0["App Clients"]
  io_1["I/O Multiplexer"]
  loop_2["Command Event Loop"]
  dict_3[("Hash Table & SDS")]
  evict_4["TTL & LFU Evictor"]
  aof_5[("AOF & RDB Fork")]
  repl_6[("Replication Backlog")]
  downstream_7["Downstream & OTel"]
  client_0 -->|"1. RESP cmd · RESP3"| io_1
  io_1 -->|"2. Parsed cmd · In-Proc"| loop_2
  loop_2 -->|"3a. O · RAM"| dict_3
  loop_2 -->|"3b. Enforce · LFU/LRU"| evict_4
  loop_2 -.->|"3c. Append AOF · Disk"| aof_5
  loop_2 -.->|"3d. Stream cmd · PSync2"| repl_6
  aof_5 -.->|"4. Emit / · OTLP/API"| downstream_7

COMPONENT STACK (8)

  • App ClientsSTATELESS
    Pipelined RESP3
  • I/O MultiplexerSTATELESS
    epoll/kqueue + threaded read
  • Command Event LoopSTATELESS
    Single-threaded atomic exec
  • Hash Table & SDSSTATEFUL
    Incremental rehash + ZSet/List
  • TTL & LFU EvictorSTATELESS
    Lazy + active sampled eviction
  • AOF & RDB ForkSTATEFUL
    COW fork snapshot + fsync 1s
  • Replication BacklogSTATEFUL
    PSync2 ring buffer to replicas
  • Downstream & OTelSTATELESS
    Consumers, metrics & SLOs

REQUEST & DATA FLOW (7)

  1. App Clients → I/O Multiplexer (RESP cmd)[RESP3]
  2. I/O Multiplexer → Command Event Loop (Parsed cmd)[In-Proc]
  3. Command Event Loop → Hash Table & SDS (O)[RAM]
  4. Command Event Loop → TTL & LFU Evictor (Enforce)[LFU/LRU]
  5. Command Event Loop → AOF & RDB Fork (Append AOF)[Disk]
  6. Command Event Loop → Replication Backlog (Stream cmd)[PSync2]
  7. AOF & RDB Fork → Downstream & OTel (Emit /)[OTLP/API]
Configure NGINX / Postgres / K8s →60-Sec L4–L7 Diagnostic →