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
[](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_5COMPONENT STACK (6)
- Entity CreatorSTATELESSNeeds global unique PK
- Timestamp SourceSTATELESS48-bit Unix ms + monotonic seq
- Bit-Field EncoderSTATELESSUUIDv7 / ULID / 64b Snowflake
- CSPRNG EntropySTATELESS74-bit random
- Sortable Primary KeySTATEFULSequential B-Tree append PK
- Downstream & OTelSTATELESSConsumers, metrics & SLOs
REQUEST & DATA FLOW (6)
- Entity Creator → Timestamp Source (Read ms)[Clock]
- Timestamp Source → Bit-Field Encoder (Pack bits)[Bitwise]
- Timestamp Source → CSPRNG Entropy (Fill rand)[CSPRNG]
- Bit-Field Encoder → Sortable Primary Key (Insert PK)[SQL]
- CSPRNG Entropy → Sortable Primary Key (Merge)[RAM]
- Sortable Primary Key → Downstream & OTel (Emit /)[OTLP/API]