Skip to main content
ARCHOS 525 BLUEPRINT · /d/dgm_distributed-cache

Distributed Cache (sharded Redis behind consistent hashing)

13 COMPONENTS · 16 FLOWS · UPDATED 2026-11-20
GITHUB README / PR PREVIEW CARD
[![Distributed Cache (sharded Redis behind consistent hashing) — ArchOS Architecture](https://archos.sageideas.dev/d/dgm_distributed-cache/opengraph-image)](https://archos.sageideas.dev/d/dgm_distributed-cache)

*Interactive architecture diagram powered by [ArchOS Studio](https://archos.sageideas.dev/d/dgm_distributed-cache)*
NOTION / DOCS / CONFLUENCE EMBED
<iframe src="https://archos.sageideas.dev/embed/dgm_distributed-cache" width="100%" height="580" style="border:1px solid rgba(240,236,225,0.14);border-radius:6px;" loading="lazy" title="Distributed Cache (sharded Redis behind consistent hashing) — Interactive in ArchOS"></iframe>
PORTABLE MERMAID SPEC (GITHUB / NOTION / RFC)
flowchart LR
  browser_0[("Browser")]
  app_1["Application server"]
  pdp_2["Policy decision point"]
  router_3["Shard router"]
  secrets_4[("Secrets manager")]
  sa_5[("Distributed cache")]
  sb_6[("Distributed cache")]
  sc_7[("Distributed cache")]
  gutter_8[("Distributed cache")]
  db_9[("PostgreSQL")]
  telemetry_10[("Traces, metrics and logs")]
  alerting_11[("Alerting")]
  capacity_12["Capacity estimate"]
  browser_0 -->|"1. Calls with a JWT · HTTPS"| app_1
  app_1 -->|"2. Asks if allowed · gRPC"| pdp_2
  pdp_2 -->|"3. Returns decision · gRPC"| app_1
  app_1 -->|"4. Asks · RESP"| router_3
  router_3 -->|"5a. By key (mTLS) · RESP"| sa_5
  router_3 -->|"5b. By key (mTLS) · RESP"| sb_6
  router_3 -->|"5c. By key (mTLS) · RESP"| sc_7
  router_3 -->|"5d. Falls back (mTLS) · RESP"| gutter_8
  sb_6 -->|"6. Hit or lease (mTLS) · RESP"| router_3
  router_3 -->|"7. Returns · RESP"| app_1
  app_1 -->|"8. Reads on miss · SQL"| db_9
  db_9 -->|"9. Returns rows · SQL"| app_1
  app_1 -->|"10. Delivers (HTTPS) · HTTPS"| browser_0
  secrets_4 -->|"Supplies credentials · HTTPS"| router_3
  router_3 -->|"Exports (OTLP) · OTLP"| telemetry_10
  telemetry_10 -->|"Feeds · HTTP"| alerting_11

COMPONENT STACK (12)

  • BrowserSTATEFUL
    Asks for a page from the user's device
  • Application serverSTATELESS
    Checks the token, adds a trace id, asks the cache
  • Policy decision pointSTATELESS
    Says whether this caller may read the key
  • Shard routerSTATELESS
    Holds the Hash ring; picks a shard from the key
  • Secrets managerSTATEFUL
    Holds cache passwords and TLS certificates
  • Distributed cacheSTATEFUL
    Shard a: its replica sits in another zone
  • Distributed cacheSTATEFUL
    Shard b: its replica sits in another zone
  • Distributed cacheSTATEFUL
    Shard c: its replica sits in another zone
  • Distributed cacheSTATEFUL
    Spare pool that takes a dead shard’s keys
  • PostgreSQLSTATEFUL
    Holds the durable data (system of record)
  • Traces, metrics and logsSTATEFUL
    Keeps hit ratio and load per shard
  • AlertingSTATEFUL
    Pages on-call on shard latency, errors or saturation

REQUEST & DATA FLOW (16)

  1. Browser → Application server (Calls with a JWT)[HTTPS]
  2. Application server → Policy decision point (Asks if allowed)[gRPC]
  3. Policy decision point → Application server (Returns decision)[gRPC]
  4. Application server → Shard router (Asks)[RESP]
  5. Shard router → Distributed cache (By key (mTLS))[RESP]
  6. Shard router → Distributed cache (By key (mTLS))[RESP]
  7. Shard router → Distributed cache (By key (mTLS))[RESP]
  8. Shard router → Distributed cache (Falls back (mTLS))[RESP]
  9. Distributed cache → Shard router (Hit or lease (mTLS))[RESP]
  10. Shard router → Application server (Returns)[RESP]
  11. Application server → PostgreSQL (Reads on miss)[SQL]
  12. PostgreSQL → Application server (Returns rows)[SQL]
  13. Application server → Browser (Delivers (HTTPS))[HTTPS]
  14. Secrets manager → Shard router (Supplies credentials)[HTTPS]
Configure NGINX / Postgres / K8s →60-Sec L4–L7 Diagnostic →