GS
genstack.tools
RFC 9562 Universally Unique Identifier

UUID v4 & UUID v7 Generator

Generate cryptographically secure UUIDv4 (pure random) and time-ordered UUIDv7 (database B-Tree index friendly) identifiers in bulk with 100% in-browser CSPRNG.

Generation Quantity:5 UUIDs
12550100
bash
uuid-v4-batch.txt
69bb00bb-1e86-4e62-8167-859be1ee1a55
e32d1d45-bf58-4529-9e07-65889a420b94
6b85b45b-fe63-423b-8a30-203faab176e6
1f5ea0f9-4a87-4e8d-ba06-507e1c8c0373
2ea1a3ee-ee78-4054-8047-629a62d752d6
FILE: uuid-v4-batch.txt·LINES: 5·SIZE: 184 B
UTF-8 READY
IETF RFC 9562 Standard (Superseding RFC 4122)

UUIDv4 Randomness vs UUIDv7 Time-Ordered Database Locality

In May 2024, the IETF ratified RFC 9562, establishing UUIDv7 as the modern successor for database primary keys. While UUIDv4 remains the gold standard for stateless uniqueness, its random distribution devastates B-Tree index write throughput.

UUIDv4: 122-Bit Entropy

UUIDv4 consists of 122 pseudo-random bits generated via CSPRNG (crypto.getRandomValues). The collision probability is negligible: generating 1 billion UUIDs per second for 85 years yields a 50% probability of a single collision ($2^122$).

The B-Tree Index Fragmentation Trap

Relational databases (PostgreSQL, MySQL InnoDB) store clustered primary keys in B-Tree leaves ordered sequentially. Because UUIDv4 values are entirely random, new insertions land on arbitrary leaf pages, triggering constant disk I/O, page splits, and cache eviction.

UUIDv7: Monotonic Chronological Ordering

UUIDv7 embeds a 48-bit millisecond Unix epoch timestamp into the most significant bits, followed by 74 bits of entropy. Successive insertions append to the right edge of B-Tree indexes, achieving high-throughput writes identical to auto-incrementing integers.

Contextual Tool Cluster · Cloud, DevOps & Developer Suite

Continue Your Engineering Workflow

Explore All 37 Specifications