ARCHOS 525 BLUEPRINT · /d/dgm_scale-from-zero
Scale from zero to millions of users
12 COMPONENTS · 14 FLOWS · UPDATED 2026-11-21
GITHUB README / PR PREVIEW CARD
[](https://archos.sageideas.dev/d/dgm_scale-from-zero) *Interactive architecture diagram powered by [ArchOS Studio](https://archos.sageideas.dev/d/dgm_scale-from-zero)*
NOTION / DOCS / CONFLUENCE EMBED
<iframe src="https://archos.sageideas.dev/embed/dgm_scale-from-zero" width="100%" height="580" style="border:1px solid rgba(240,236,225,0.14);border-radius:6px;" loading="lazy" title="Scale from zero to millions of users — Interactive in ArchOS"></iframe>
PORTABLE MERMAID SPEC (GITHUB / NOTION / RFC)
flowchart LR
client_0[("Web Client")]
capacity_1["Capacity estimate"]
cdn_2[("Content delivery network (CDN)")]
lb_3["Layer 7 load balancer"]
scaler_4["Autoscaler"]
app_5["Application server"]
cache_6[("Distributed cache")]
leader_7[("PostgreSQL")]
queue_8[("Message queue")]
shard2_9[("PostgreSQL")]
replica_10[("Read replica")]
worker_11["Competing consumers"]
client_0 -->|"1a. Fetches · HTTPS"| cdn_2
client_0 -->|"1b. Calls API · HTTPS"| lb_3
lb_3 -->|"2. Forwards · HTTP/2"| app_5
app_5 -->|"3a. Looks up · RESP"| cache_6
app_5 -->|"3b. Reads · SQL"| replica_10
app_5 -->|"3c. Writes · SQL"| leader_7
app_5 -->|"3d. Writes · SQL"| shard2_9
app_5 -.->|"3e. Queues job · TCP"| queue_8
leader_7 -->|"4a. Copies log · TCP"| replica_10
queue_8 -.->|"4b. Sends · TCP"| worker_11
replica_10 -->|"5. Replies · SQL"| app_5
app_5 -->|"6. Replies · HTTP/2"| lb_3
lb_3 -->|"7. Replies · HTTPS"| client_0
scaler_4 -->|"Adds servers · HTTP"| app_5COMPONENT STACK (11)
- Web ClientSTATEFULLoads pages and calls the API
- Content delivery network (CDN)STATEFULServes images and scripts from the edge
- Layer 7 load balancerSTATELESSSpreads requests over the servers
- AutoscalerSTATELESSAdds servers when load rises
- Application serverSTATELESSStateless; any copy can answer
- Distributed cacheSTATEFULKeeps hot rows in memory
- PostgreSQLSTATEFULShard 1 leader: takes the writes
- Message queueSTATEFULHolds slow jobs for the workers
- PostgreSQLSTATEFULShard 2 leader: other keys
- Read replicaSTATEFULCopy of the leader that serves reads
- Competing consumersSTATELESSDrain jobs at a steady rate
REQUEST & DATA FLOW (14)
- Web Client → Content delivery network (CDN) (Fetches)[HTTPS]
- Web Client → Layer 7 load balancer (Calls API)[HTTPS]
- Layer 7 load balancer → Application server (Forwards)[HTTP/2]
- Application server → Distributed cache (Looks up)[RESP]
- Application server → Read replica (Reads)[SQL]
- Application server → PostgreSQL (Writes)[SQL]
- Application server → PostgreSQL (Writes)[SQL]
- Application server → Message queue (Queues job)[TCP]
- PostgreSQL → Read replica (Copies log)[TCP]
- Message queue → Competing consumers (Sends)[TCP]
- Read replica → Application server (Replies)[SQL]
- Application server → Layer 7 load balancer (Replies)[HTTP/2]
- Layer 7 load balancer → Web Client (Replies)[HTTPS]
- Autoscaler → Application server (Adds servers)[HTTP]