Strange Loop is an annual systems and programming conference known for deep technical content on distributed systems, languages, and databases. The 2025 edition featured talks on identifier design at scale — a practical concern for any system that generates millions of records across multiple nodes. Sessions examined UUID v7’s adoption trajectory following RFC 9562, the B-tree performance implications measured in production databases, and the remaining cases where other ID formats remain the better choice. This page summarises the key technical arguments from those sessions.

The identifier format landscape in 2025

Sessions opened with a taxonomy of the current identifier options:

FormatPrecisionLengthStandardDB native type
UUID v4None (random)36 charsRFC 9562Yes
UUID v748-bit ms36 charsRFC 9562Yes
ULID48-bit ms26 charsCommunityNo
Snowflake ID41-bit ms + node18 digitsTwitter internalNo
KSUID32-bit second27 charsCommunityNo
NanoIDNone21 charsCommunityNo

The consensus: UUID v7 is now the default choice for systems that care about index performance and need a standard format. The remaining debate is around the edge cases.

B-tree index fragmentation at scale

A data-heavy session presented PostgreSQL B-tree measurements at real production scale:

The core mechanism: UUID v4 inserts land at a random position in the B-tree index on every write. Each insert triggers a page split roughly 50% of the time once the index is full, doubling the number of pages and causing read amplification for range scans. At 100 million rows, a UUID v4 index is typically 40–60% larger than a UUID v7 index for the same data — the extra space is wasted due to half-empty pages from splits.

UUID v7 inserts always append to the rightmost leaf page. The fill factor can be tuned higher (90–95%) because splits only occur at the right edge. The PostgreSQL B-tree implementation documentation explains fill factor and the fastpath optimisation for monotonic inserts.

Coordination-free ordering: the millisecond problem

A session on distributed systems theory examined what UUID v7 actually guarantees:

Within a single node: UUID v7 with a monotonic counter is strictly ordered — two UUIDs generated in the same millisecond are ordered by the counter, not by random bits. Up to 4,096 ordered UUIDs per millisecond per node.

Across nodes: UUID v7 is ordered only to millisecond precision. If Node A generates a UUID at t=1000ms and Node B generates one at t=999ms, B’s UUID sorts before A’s — the order reflects wall-clock time, not causal order. This is acceptable for database primary keys (row creation order) but not for strict event ordering across services.

For strict causal ordering, you need logical clocks or a sequencer. The Wikipedia article on logical clocks covers Lamport timestamps and vector clocks as alternatives when causal ordering is required.

When not to use UUID v7

Sessions explicitly covered cases where UUID v7 is not the right choice:

Public-facing resource IDs in URLs: UUID v7 discloses creation time to the millisecond. For user account IDs, document IDs in public URLs, and API resource IDs seen by untrusted clients, use UUID v4. The timestamp in a UUID v7 reveals when a user account was created, which may violate privacy expectations and enable user enumeration (account created before date X has a UUID v7 starting with prefix Y).

Session tokens and capability grants: Neither UUID v4 nor UUID v7 is appropriate as a session token. Session tokens must be secrets — use 256-bit random bytes from a CSPRNG, not a UUID. The OWASP Top 10 covers broken authentication and session management.

Cross-database foreign keys: UUID v7 timestamps from different databases may conflict if clocks differ by more than a millisecond. For distributed transactions across systems with independent clocks, the random bits (74 bits) provide sufficient collision resistance — the timestamp is a bonus, not a guarantee of uniqueness.

UUID v7 in new language runtimes

Sessions surveyed native UUID v7 support arriving in 2025–2026:

The convergence on standard library support reduces the need for third-party dependencies in new projects. For existing projects using the uuid npm package or uuid-creator for Java, migration is not urgent — these libraries remain well-maintained.

Further reading

External references

Frequently asked questions

What identifier design themes were covered at Strange Loop 2025?

Sessions at Strange Loop 2025 examined the trade-off space for distributed identifiers — comparing UUID v4, UUID v7, ULID, Snowflake IDs, and KSUID across dimensions of sortability, entropy, coordination requirements, and database index behaviour. A recurring theme was the convergence on UUID v7 as the practical standard following RFC 9562 publication in May 2024 and native PostgreSQL 18 support.

What is the coordination-free ordering problem for distributed IDs?

In a distributed system with multiple nodes, generating strictly ordered IDs requires either a central coordinator (a sequencer service, a database sequence) or a timestamp-based scheme that accepts approximate ordering. UUID v7 solves this with millisecond-precision timestamps and a monotonic counter for within-millisecond ordering on each node. Two nodes generating UUIDs in the same millisecond produce values that are time-ordered within each node but may interleave differently at the global level — an acceptable trade-off for most systems. The Wikipedia article on logical clocks covers the theoretical background.

How does UUID v7 compare to KSUID for distributed systems?

KSUID (K-Sortable Unique Identifier) uses a 32-bit second-precision timestamp plus 128 bits of randomness, encoded in base62. UUID v7 uses a 48-bit millisecond-precision timestamp plus 74 bits of randomness, encoded in the standard 8-4-4-4-12 hex format. UUID v7 has finer timestamp precision (milliseconds vs seconds) and is an IETF standard with native database type support. KSUID is more compact in base62 form (~27 chars vs 36) but lacks an RFC and native database types. The KSUID specification on GitHub documents the format.