Skip to main content
ARCHOS 525 BLUEPRINT · /d/dgm_code-id-generation-algorithms

Unique ID Generation Algorithms (UUIDv7, ULID, Snowflake & KSUID)

6 COMPONENTS · 6 FLOWS · UPDATED 2026-11-24
GITHUB README / PR PREVIEW CARD
[![Unique ID Generation Algorithms (UUIDv7, ULID, Snowflake & KSUID) — ArchOS Architecture](https://archos.sageideas.dev/d/dgm_code-id-generation-algorithms/opengraph-image)](https://archos.sageideas.dev/d/dgm_code-id-generation-algorithms)

*Interactive architecture diagram powered by [ArchOS Studio](https://archos.sageideas.dev/d/dgm_code-id-generation-algorithms)*
NOTION / DOCS / CONFLUENCE EMBED
<iframe src="https://archos.sageideas.dev/embed/dgm_code-id-generation-algorithms" width="100%" height="580" style="border:1px solid rgba(240,236,225,0.14);border-radius:6px;" loading="lazy" title="Unique ID Generation Algorithms (UUIDv7, ULID, Snowflake & KSUID) — Interactive in ArchOS"></iframe>
PORTABLE MERMAID SPEC (GITHUB / NOTION / RFC)
flowchart LR
  client_0["Entity Creator"]
  n1_1["Timestamp Source"]
  n2a_2["Bit-Field Encoder"]
  n2b_3["CSPRNG Entropy"]
  n3_4[("Sortable Primary Key")]
  downstream_5["Downstream & OTel"]
  client_0 -->|"1. Read ms · Clock"| n1_1
  n1_1 -->|"2a. Pack bits · Bitwise"| n2a_2
  n1_1 -->|"2b. Fill rand · CSPRNG"| n2b_3
  n2a_2 -->|"3a. Insert PK · SQL"| n3_4
  n2b_3 -->|"3b. Merge · RAM"| n3_4
  n3_4 -.->|"4. Emit / · OTLP/API"| downstream_5

COMPONENT STACK (6)

  • Entity CreatorSTATELESS
    Needs global unique PK
  • Timestamp SourceSTATELESS
    48-bit Unix ms + monotonic seq
  • Bit-Field EncoderSTATELESS
    UUIDv7 / ULID / 64b Snowflake
  • CSPRNG EntropySTATELESS
    74-bit random
  • Sortable Primary KeySTATEFUL
    Sequential B-Tree append PK
  • Downstream & OTelSTATELESS
    Consumers, metrics & SLOs

REQUEST & DATA FLOW (6)

  1. Entity Creator → Timestamp Source (Read ms)[Clock]
  2. Timestamp Source → Bit-Field Encoder (Pack bits)[Bitwise]
  3. Timestamp Source → CSPRNG Entropy (Fill rand)[CSPRNG]
  4. Bit-Field Encoder → Sortable Primary Key (Insert PK)[SQL]
  5. CSPRNG Entropy → Sortable Primary Key (Merge)[RAM]
  6. Sortable Primary Key → Downstream & OTel (Emit /)[OTLP/API]
Configure NGINX / Postgres / K8s →60-Sec L4–L7 Diagnostic →