Skip to main content
ARCHOS 525 BLUEPRINT · /d/dgm_unique-id-generator

Unique ID Generator (Snowflake-style, 64-bit time-ordered ids)

8 COMPONENTS · 10 FLOWS · UPDATED 2026-11-20
GITHUB README / PR PREVIEW CARD
[![Unique ID Generator (Snowflake-style, 64-bit time-ordered ids) — ArchOS Architecture](https://archos.sageideas.dev/d/dgm_unique-id-generator/opengraph-image)](https://archos.sageideas.dev/d/dgm_unique-id-generator)

*Interactive architecture diagram powered by [ArchOS Studio](https://archos.sageideas.dev/d/dgm_unique-id-generator)*
NOTION / DOCS / CONFLUENCE EMBED
<iframe src="https://archos.sageideas.dev/embed/dgm_unique-id-generator" width="100%" height="580" style="border:1px solid rgba(240,236,225,0.14);border-radius:6px;" loading="lazy" title="Unique ID Generator (Snowflake-style, 64-bit time-ordered ids) — Interactive in ArchOS"></iframe>
PORTABLE MERMAID SPEC (GITHUB / NOTION / RFC)
flowchart LR
  app_0[("Application Service")]
  ntp_1[("NTP Time Server")]
  lb_2["Layer 4 load balancer"]
  g1_3[("Unique ID generator")]
  g2_4[("Unique ID generator")]
  cfg_5[("Dynamic configuration service")]
  metrics_6[("Traces, metrics and logs")]
  capacity_7["Capacity card"]
  app_0 -->|"1. Requests an id (mTLS) · Apache Thrift"| lb_2
  lb_2 -->|"2a. Routes to worker 1 · TCP"| g1_3
  lb_2 -->|"2b. Routes to worker 2 · TCP"| g2_4
  g1_3 -->|"3a. Returns the id or error · TCP"| lb_2
  g2_4 -->|"3b. Returns the id or error · TCP"| lb_2
  lb_2 -->|"4. Relays the id or error · Apache Thrift"| app_0
  g1_3 -->|"Reads its worker id · HTTPS"| cfg_5
  g2_4 -->|"Reads its worker id · HTTPS"| cfg_5
  ntp_1 -->|"Syncs the clock (NTP) · NTP"| g1_3
  g2_4 -->|"Exports (OTLP) · OTLP"| metrics_6

COMPONENT STACK (8)

  • Application ServiceSTATEFUL
    Needs a unique id for each new record
  • NTP Time ServerSTATEFUL
    Keeps every machine's clock accurate
  • Layer 4 load balancerSTATELESS
    Spreads connections over the workers
  • Unique ID generatorSTATEFUL
    Worker 1 packs time, worker id 1 and a sequence number
  • Unique ID generatorSTATEFUL
    Worker 2 packs time, worker id 2 and a sequence number
  • Dynamic configuration serviceSTATEFUL
    Holds each worker's unique configured id
  • Traces, metrics and logsSTATEFUL
    Ids per second and clock errors per worker
  • Capacity cardSTATELESS
    Sizing from the published Snowflake layout

REQUEST & DATA FLOW (10)

  1. Application Service → Layer 4 load balancer (Requests an id (mTLS))[Apache Thrift]
  2. Layer 4 load balancer → Unique ID generator (Routes to worker 1)[TCP]
  3. Layer 4 load balancer → Unique ID generator (Routes to worker 2)[TCP]
  4. Unique ID generator → Layer 4 load balancer (Returns the id or error)[TCP]
  5. Unique ID generator → Layer 4 load balancer (Returns the id or error)[TCP]
  6. Layer 4 load balancer → Application Service (Relays the id or error)[Apache Thrift]
  7. Unique ID generator → Dynamic configuration service (Reads its worker id)[HTTPS]
  8. Unique ID generator → Dynamic configuration service (Reads its worker id)[HTTPS]
  9. NTP Time Server → Unique ID generator (Syncs the clock (NTP))[NTP]
  10. Unique ID generator → Traces, metrics and logs (Exports (OTLP))[OTLP]
Configure NGINX / Postgres / K8s →60-Sec L4–L7 Diagnostic →