Skip to main content
ARCHOS 525 BLUEPRINT · /d/dgm_presence-service

Real-Time Presence Service (Heartbeats, Lease Expiry & Fan-Out)

6 COMPONENTS · 6 FLOWS · UPDATED 2026-11-24
GITHUB README / PR PREVIEW CARD
[![Real-Time Presence Service (Heartbeats, Lease Expiry & Fan-Out) — ArchOS Architecture](https://archos.sageideas.dev/d/dgm_presence-service/opengraph-image)](https://archos.sageideas.dev/d/dgm_presence-service)

*Interactive architecture diagram powered by [ArchOS Studio](https://archos.sageideas.dev/d/dgm_presence-service)*
NOTION / DOCS / CONFLUENCE EMBED
<iframe src="https://archos.sageideas.dev/embed/dgm_presence-service" width="100%" height="580" style="border:1px solid rgba(240,236,225,0.14);border-radius:6px;" loading="lazy" title="Real-Time Presence Service (Heartbeats, Lease Expiry & Fan-Out) — Interactive in ArchOS"></iframe>
PORTABLE MERMAID SPEC (GITHUB / NOTION / RFC)
flowchart LR
  client_0["Chat & Social Clients"]
  n1_1["WebSocket Edge Pool"]
  n2a_2[("Presence Lease Tier")]
  n2b_3["Fan-Out Broker"]
  n3_4[("Last-Seen Store")]
  downstream_5["Downstream & OTel"]
  client_0 -->|"1. Heartbeat · WSS"| n1_1
  n1_1 -->|"2a. Renew TTL · Redis"| n2a_2
  n1_1 -.->|"2b. Status · PubSub"| n2b_3
  n2a_2 -->|"3a. Save last · SQL"| n3_4
  n2b_3 -->|"3b. Apply · Async"| n3_4
  n3_4 -.->|"4. Emit / · OTLP/API"| downstream_5

COMPONENT STACK (6)

  • Chat & Social ClientsSTATELESS
    Periodic 30s heartbeats
  • WebSocket Edge PoolSTATELESS
    Millions of persistent conns
  • Presence Lease TierSTATEFUL
    Redis TTL leases
  • Fan-Out BrokerSTATELESS
    Pub/Sub to active watchers
  • Last-Seen StoreSTATEFUL
    Debounced offline timestamps
  • Downstream & OTelSTATELESS
    Consumers, metrics & SLOs

REQUEST & DATA FLOW (6)

  1. Chat & Social Clients → WebSocket Edge Pool (Heartbeat)[WSS]
  2. WebSocket Edge Pool → Presence Lease Tier (Renew TTL)[Redis]
  3. WebSocket Edge Pool → Fan-Out Broker (Status)[PubSub]
  4. Presence Lease Tier → Last-Seen Store (Save last)[SQL]
  5. Fan-Out Broker → Last-Seen Store (Apply)[Async]
  6. Last-Seen Store → Downstream & OTel (Emit /)[OTLP/API]
Configure NGINX / Postgres / K8s →60-Sec L4–L7 Diagnostic →