Skip to main content
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
[![Scale from zero to millions of users — ArchOS Architecture](https://archos.sageideas.dev/d/dgm_scale-from-zero/opengraph-image)](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_5

COMPONENT STACK (11)

  • Web ClientSTATEFUL
    Loads pages and calls the API
  • Content delivery network (CDN)STATEFUL
    Serves images and scripts from the edge
  • Layer 7 load balancerSTATELESS
    Spreads requests over the servers
  • AutoscalerSTATELESS
    Adds servers when load rises
  • Application serverSTATELESS
    Stateless; any copy can answer
  • Distributed cacheSTATEFUL
    Keeps hot rows in memory
  • PostgreSQLSTATEFUL
    Shard 1 leader: takes the writes
  • Message queueSTATEFUL
    Holds slow jobs for the workers
  • PostgreSQLSTATEFUL
    Shard 2 leader: other keys
  • Read replicaSTATEFUL
    Copy of the leader that serves reads
  • Competing consumersSTATELESS
    Drain jobs at a steady rate

REQUEST & DATA FLOW (14)

  1. Web Client → Content delivery network (CDN) (Fetches)[HTTPS]
  2. Web Client → Layer 7 load balancer (Calls API)[HTTPS]
  3. Layer 7 load balancer → Application server (Forwards)[HTTP/2]
  4. Application server → Distributed cache (Looks up)[RESP]
  5. Application server → Read replica (Reads)[SQL]
  6. Application server → PostgreSQL (Writes)[SQL]
  7. Application server → PostgreSQL (Writes)[SQL]
  8. Application server → Message queue (Queues job)[TCP]
  9. PostgreSQL → Read replica (Copies log)[TCP]
  10. Message queue → Competing consumers (Sends)[TCP]
  11. Read replica → Application server (Replies)[SQL]
  12. Application server → Layer 7 load balancer (Replies)[HTTP/2]
  13. Layer 7 load balancer → Web Client (Replies)[HTTPS]
  14. Autoscaler → Application server (Adds servers)[HTTP]
Configure NGINX / Postgres / K8s →60-Sec L4–L7 Diagnostic →