Article may be outdated

This article is 3 days old. Some details may have changed since publication.

Hacker News·3 min read·hard

UUIDv7 doesn't have the properties you think it does

I
ibobev
✦AI Summary

This technical analysis argues that UUIDv7 does not reliably provide the properties often attributed to it, such as strict creation-time ordering. The author highlights that RFC 9562 allows implementations to deviate from system clocks, potentially leading to inaccurate timestamps.

Why it matters

Developers relying on UUIDv7 for database indexing or time-sensitive operations may face unexpected data integrity issues if they assume strict monotonicity.

✦Dive DeeperCreate a free account to unlock

Most blog posts about UUIDv7 tout these benefits:

But none of these properties are strictly held. Certain RFC compliant implementations of UUIDv7 violate these properties to extreme degrees. The only useful property UUIDv7 appears to strictly provide is uniqueness and therefore collision resistance. I've already discussed how UUIDv7 IDs can be guessable , so this post explores the other properties.

Superficially, it seems that embedding a timestamp in the ID can remove the need to track the creation time in a separate database column, providing marginally more efficient database operations. If you need to list things ordered by creation time very often, it's useful if the primary index gives that behavior, removing the need for another index.

Continue reading on Headlinne

Create a free account to read the full article.

Read full article →
technologyscience
✦

Get smarter about the news

Sign up free for a feed built around what you actually care about, Dive Deeper research on any story, and the full text of every article.

Create free account

Already have an account? Sign in