ARCHOS 525 BLUEPRINT · /d/dgm_url-shortener
URL Shortener (read-heavy key-value design)
13 COMPONENTS · 16 FLOWS · UPDATED 2026-11-19
GITHUB README / PR PREVIEW CARD
[](https://archos.sageideas.dev/d/dgm_url-shortener) *Interactive architecture diagram powered by [ArchOS Studio](https://archos.sageideas.dev/d/dgm_url-shortener)*
NOTION / DOCS / CONFLUENCE EMBED
<iframe src="https://archos.sageideas.dev/embed/dgm_url-shortener" width="100%" height="580" style="border:1px solid rgba(240,236,225,0.14);border-radius:6px;" loading="lazy" title="URL Shortener (read-heavy key-value design) — Interactive in ArchOS"></iframe>
PORTABLE MERMAID SPEC (GITHUB / NOTION / RFC)
flowchart LR
creator_0[("Link Creator")]
visitor_1[("Link Visitor")]
lb_2["Layer 7 load balancer"]
shorten_3["Shorten service"]
redirect_4["Redirect service"]
idgen_5[("Unique ID generator")]
db_6[("System of record")]
cache_7[("Distributed cache")]
queue_8[("Message queue")]
consumer_9["Idempotent consumer"]
rollup_10[("Analytics rollup store")]
telemetry_11[("Traces, metrics and logs")]
capacity_12["Capacity estimate"]
creator_0 -->|"1a. Submits long URL (REST) · HTTPS"| lb_2
visitor_1 -->|"1b. Opens short link · HTTPS"| lb_2
lb_2 -->|"2a. Create request · HTTP/2"| shorten_3
lb_2 -->|"2b. Follow request · HTTP/2"| redirect_4
shorten_3 -->|"3a. Stores short code · SQL"| db_6
shorten_3 -->|"3b. Short link · HTTP/2"| lb_2
redirect_4 -->|"3c. Looks up link · RESP"| cache_7
redirect_4 -->|"3d. Reads leader on miss · SQL"| db_6
redirect_4 -->|"3e. Redirect · HTTP/2"| lb_2
redirect_4 -.->|"3f. Publishes click event · AMQP"| queue_8
lb_2 -->|"4a. Relays short link (REST) · HTTPS"| creator_0
lb_2 -->|"4b. Sends 302 redirect · HTTPS"| visitor_1
queue_8 -.->|"4c. Delivers events · AMQP"| consumer_9
consumer_9 -->|"5. Counts clicks · SQL"| rollup_10
shorten_3 -->|"Requests id block · RPC"| idgen_5
lb_2 -->|"Exports (OTLP) · OTLP"| telemetry_11COMPONENT STACK (12)
- Link CreatorSTATEFULSubmits a long URL to shorten
- Link VisitorSTATEFULOpens a short link in a browser
- Layer 7 load balancerSTATELESSRoutes create and follow requests by path
- Shorten serviceSTATELESSBuilds short codes from leased ids
- Redirect serviceSTATELESSLooks up a link and sends the redirect
- Unique ID generatorSTATEFULHands out id blocks from one durable counter
- System of recordSTATEFULStores every short code and its long URL
- Distributed cacheSTATEFULKeeps hot links in memory (cache-aside)
- Message queueSTATEFULBuffers click events off the redirect path
- Idempotent consumerSTATELESSSkips repeated click ids, then counts the click
- Analytics rollup storeSTATEFULCounts clicks per link and hour (rollup rows)
- Traces, metrics and logsSTATEFULRequest rate, latency and error rate
REQUEST & DATA FLOW (16)
- Link Creator → Layer 7 load balancer (Submits long URL (REST))[HTTPS]
- Link Visitor → Layer 7 load balancer (Opens short link)[HTTPS]
- Layer 7 load balancer → Shorten service (Create request)[HTTP/2]
- Layer 7 load balancer → Redirect service (Follow request)[HTTP/2]
- Shorten service → System of record (Stores short code)[SQL]
- Shorten service → Layer 7 load balancer (Short link)[HTTP/2]
- Redirect service → Distributed cache (Looks up link)[RESP]
- Redirect service → System of record (Reads leader on miss)[SQL]
- Redirect service → Layer 7 load balancer (Redirect)[HTTP/2]
- Redirect service → Message queue (Publishes click event)[AMQP]
- Layer 7 load balancer → Link Creator (Relays short link (REST))[HTTPS]
- Layer 7 load balancer → Link Visitor (Sends 302 redirect)[HTTPS]
- Message queue → Idempotent consumer (Delivers events)[AMQP]
- Idempotent consumer → Analytics rollup store (Counts clicks)[SQL]