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
[](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_5COMPONENT STACK (6)
- Chat & Social ClientsSTATELESSPeriodic 30s heartbeats
- WebSocket Edge PoolSTATELESSMillions of persistent conns
- Presence Lease TierSTATEFULRedis TTL leases
- Fan-Out BrokerSTATELESSPub/Sub to active watchers
- Last-Seen StoreSTATEFULDebounced offline timestamps
- Downstream & OTelSTATELESSConsumers, metrics & SLOs
REQUEST & DATA FLOW (6)
- Chat & Social Clients → WebSocket Edge Pool (Heartbeat)[WSS]
- WebSocket Edge Pool → Presence Lease Tier (Renew TTL)[Redis]
- WebSocket Edge Pool → Fan-Out Broker (Status)[PubSub]
- Presence Lease Tier → Last-Seen Store (Save last)[SQL]
- Fan-Out Broker → Last-Seen Store (Apply)[Async]
- Last-Seen Store → Downstream & OTel (Emit /)[OTLP/API]