Skip to main content
ARCHOS 525 BLUEPRINT · /d/dgm_code-radix-trees-and-longest-prefix-match

Radix Trees (Patricia Trie) & Longest Prefix Match Routing

6 COMPONENTS · 6 FLOWS · UPDATED 2026-11-24
GITHUB README / PR PREVIEW CARD
[![Radix Trees (Patricia Trie) & Longest Prefix Match Routing — ArchOS Architecture](https://archos.sageideas.dev/d/dgm_code-radix-trees-and-longest-prefix-match/opengraph-image)](https://archos.sageideas.dev/d/dgm_code-radix-trees-and-longest-prefix-match)

*Interactive architecture diagram powered by [ArchOS Studio](https://archos.sageideas.dev/d/dgm_code-radix-trees-and-longest-prefix-match)*
NOTION / DOCS / CONFLUENCE EMBED
<iframe src="https://archos.sageideas.dev/embed/dgm_code-radix-trees-and-longest-prefix-match" width="100%" height="580" style="border:1px solid rgba(240,236,225,0.14);border-radius:6px;" loading="lazy" title="Radix Trees (Patricia Trie) & Longest Prefix Match Routing — Interactive in ArchOS"></iframe>
PORTABLE MERMAID SPEC (GITHUB / NOTION / RFC)
flowchart LR
  client_0["Packet / HTTP Path"]
  n1_1["Path Normalizer"]
  n2a_2[("Compressed Radix Nodes")]
  n2b_3["Param & Wildcard Slot"]
  n3_4["Matched Handler / Route"]
  downstream_5["Downstream & OTel"]
  client_0 -->|"1. Tokenize · Key"| n1_1
  n1_1 -->|"2a. Match edge · Radix"| n2a_2
  n1_1 -->|"2b. LPM select · Match"| n2b_3
  n2a_2 -->|"3a. Dispatch · Route"| n3_4
  n2b_3 -->|"3b. Merge · RAM"| n3_4
  n3_4 -.->|"4. Emit / · OTLP/API"| downstream_5

COMPONENT STACK (6)

  • Packet / HTTP PathSTATELESS
    IP CIDR or /api/v1/:id
  • Path NormalizerSTATELESS
    Bits / URL path segments
  • Compressed Radix NodesSTATEFUL
    Merges single-child chains
  • Param & Wildcard SlotSTATELESS
    Captures :id & CIDR masks
  • Matched Handler / RouteSTATELESS
    O zero-alloc dispatch
  • Downstream & OTelSTATELESS
    Consumers, metrics & SLOs

REQUEST & DATA FLOW (6)

  1. Packet / HTTP Path → Path Normalizer (Tokenize)[Key]
  2. Path Normalizer → Compressed Radix Nodes (Match edge)[Radix]
  3. Path Normalizer → Param & Wildcard Slot (LPM select)[Match]
  4. Compressed Radix Nodes → Matched Handler / Route (Dispatch)[Route]
  5. Param & Wildcard Slot → Matched Handler / Route (Merge)[RAM]
  6. Matched Handler / Route → Downstream & OTel (Emit /)[OTLP/API]
Configure NGINX / Postgres / K8s →60-Sec L4–L7 Diagnostic →