Skip to main content
ARCHOS 525 BLUEPRINT · /d/dgm_news-feed-v3

Design a news feed

16 COMPONENTS · 18 FLOWS · UPDATED 2026-11-21
GITHUB README / PR PREVIEW CARD
[![Design a news feed — ArchOS Architecture](https://archos.sageideas.dev/d/dgm_news-feed-v3/opengraph-image)](https://archos.sageideas.dev/d/dgm_news-feed-v3)

*Interactive architecture diagram powered by [ArchOS Studio](https://archos.sageideas.dev/d/dgm_news-feed-v3)*
NOTION / DOCS / CONFLUENCE EMBED
<iframe src="https://archos.sageideas.dev/embed/dgm_news-feed-v3" width="100%" height="580" style="border:1px solid rgba(240,236,225,0.14);border-radius:6px;" loading="lazy" title="Design a news feed — Interactive in ArchOS"></iframe>
PORTABLE MERMAID SPEC (GITHUB / NOTION / RFC)
flowchart LR
  client_0[("Web Client")]
  secrets_1[("Secrets manager")]
  gw_2["API gateway"]
  policy_3["Policy decision point"]
  post_4["Post service"]
  postdb_5[("PostgreSQL")]
  feed_6["Read service"]
  metrics_7[("Metrics")]
  cdc_8[("Change Data Capture (CDC)")]
  alerting_9[("Alerting")]
  fan_10["Competing consumers"]
  log_11[("Event log")]
  graph_12[("Social graph")]
  dlq_13[("Dead-letter queue")]
  cache_14[("Distributed cache")]
  capacity_15["Capacity estimate"]
  client_0 -->|"1. Calls with JWT · HTTPS"| gw_2
  gw_2 -->|"Asks · HTTPS"| policy_3
  gw_2 -->|"2a. mTLS · HTTPS"| post_4
  gw_2 -->|"2b. mTLS · HTTPS"| feed_6
  post_4 -->|"3a. Write · SQL"| postdb_5
  feed_6 -->|"3b. Read · TCP"| cache_14
  postdb_5 -.->|"4a. Feeds · TCP"| cdc_8
  cache_14 -->|"4b. Reply · TCP"| feed_6
  cdc_8 -.->|"5a. Sends · TCP"| log_11
  feed_6 -->|"5b. Reply · HTTPS"| gw_2
  log_11 -.->|"6a. Delivers · TCP"| fan_10
  gw_2 -->|"6b. Reply · HTTPS"| client_0
  fan_10 -->|"7a. Reads · TCP"| graph_12
  fan_10 -->|"7b. Writes · TCP"| cache_14
  fan_10 -.->|"7c. Parks · TCP"| dlq_13
  secrets_1 -->|"Keys · HTTPS"| fan_10
  post_4 -->|"Emits · HTTP"| metrics_7
  metrics_7 -->|"Pages · HTTP"| alerting_9

COMPONENT STACK (15)

  • Web ClientSTATEFUL
    Posts and reads feeds from an untrusted network
  • Secrets managerSTATEFUL
    Credentials for the consumers
  • API gatewaySTATELESS
    Checks the JWT, sheds load, forwards
  • Policy decision pointSTATELESS
    Allows or denies each request
  • Post serviceSTATELESS
    Accepts a new post once per key
  • PostgreSQLSTATEFUL
    System of record for posts
  • Read serviceSTATELESS
    Builds one page of a feed
  • MetricsSTATEFUL
    Signals: Post latency and errors
  • Change Data Capture (CDC)STATEFUL
    Turns database changes into events
  • AlertingSTATEFUL
    Pages on-call on error spikes
  • Competing consumersSTATELESS
    Fan out posts to follower feeds
  • Event logSTATEFUL
    Kafka topic keyed by user id
  • Social graphSTATEFUL
    Who follows whom
  • Dead-letter queueSTATEFUL
    Parks posts that keep failing
  • Distributed cacheSTATEFUL
    Precomputed feed for each user

REQUEST & DATA FLOW (18)

  1. Web Client → API gateway (Calls with JWT)[HTTPS]
  2. API gateway → Policy decision point (Asks)[HTTPS]
  3. API gateway → Post service (mTLS)[HTTPS]
  4. API gateway → Read service (mTLS)[HTTPS]
  5. Post service → PostgreSQL (Write)[SQL]
  6. Read service → Distributed cache (Read)[TCP]
  7. PostgreSQL → Change Data Capture (CDC) (Feeds)[TCP]
  8. Distributed cache → Read service (Reply)[TCP]
  9. Change Data Capture (CDC) → Event log (Sends)[TCP]
  10. Read service → API gateway (Reply)[HTTPS]
  11. Event log → Competing consumers (Delivers)[TCP]
  12. API gateway → Web Client (Reply)[HTTPS]
  13. Competing consumers → Social graph (Reads)[TCP]
  14. Competing consumers → Distributed cache (Writes)[TCP]
Configure NGINX / Postgres / K8s →60-Sec L4–L7 Diagnostic →