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
[](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_9COMPONENT STACK (15)
- Web ClientSTATEFULPosts and reads feeds from an untrusted network
- Secrets managerSTATEFULCredentials for the consumers
- API gatewaySTATELESSChecks the JWT, sheds load, forwards
- Policy decision pointSTATELESSAllows or denies each request
- Post serviceSTATELESSAccepts a new post once per key
- PostgreSQLSTATEFULSystem of record for posts
- Read serviceSTATELESSBuilds one page of a feed
- MetricsSTATEFULSignals: Post latency and errors
- Change Data Capture (CDC)STATEFULTurns database changes into events
- AlertingSTATEFULPages on-call on error spikes
- Competing consumersSTATELESSFan out posts to follower feeds
- Event logSTATEFULKafka topic keyed by user id
- Social graphSTATEFULWho follows whom
- Dead-letter queueSTATEFULParks posts that keep failing
- Distributed cacheSTATEFULPrecomputed feed for each user
REQUEST & DATA FLOW (18)
- Web Client → API gateway (Calls with JWT)[HTTPS]
- API gateway → Policy decision point (Asks)[HTTPS]
- API gateway → Post service (mTLS)[HTTPS]
- API gateway → Read service (mTLS)[HTTPS]
- Post service → PostgreSQL (Write)[SQL]
- Read service → Distributed cache (Read)[TCP]
- PostgreSQL → Change Data Capture (CDC) (Feeds)[TCP]
- Distributed cache → Read service (Reply)[TCP]
- Change Data Capture (CDC) → Event log (Sends)[TCP]
- Read service → API gateway (Reply)[HTTPS]
- Event log → Competing consumers (Delivers)[TCP]
- API gateway → Web Client (Reply)[HTTPS]
- Competing consumers → Social graph (Reads)[TCP]
- Competing consumers → Distributed cache (Writes)[TCP]