frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

Open in hackernews

UUIDv7 doesn't have the properties you think it does

https://alexsci.com/blog/uuidv7-is-weird/
45•ibobev•1h ago

Comments

pphysch•1h ago
> My mental model for UUIDv7 is that it’s a mash-up of a bunch of different ideas which implementations are free to choose as they see fit. There’s a wide variance of properties that UUIDv7 implementations can provide, with varying degrees of certainty they can successfully provide those properties.

I think this is good. A proper UUID that has specific significant bits dedicated to (approximately) monotonic values is useful. I don't want it over-specified beyond that, and I don't want to just use UUIDv8.

sedatk•55m ago
You probably don't need a UUID: https://ssg.dev/you-probably-dont-need-a-uuid/
kune•28m ago
I support this. I wrote a Sqlite plugin for KSUIDs, but at the end I never used them, since all I do can be handled by integer primary keys, which sqlite maps to the rowid automatically. Autoincrement is only required, if you want to prevent the reuse of ids in deleted rows.
mahboi•10m ago
For a database primary key, yeah. Just use serial.
nodamage•4m ago
...if you're writing an application with a centralized database.
jefecoon•53m ago
Great article.

I assume I'm oblivious and naive, but it seems theoretically possible these issues could -- theoretically -- result in TOCTOU or similar issues.

Any thoughts about relying on:

- central time service, with message-queue of inbound requests, resulting in correctly timed + sequenced events [ albeit with hopefully small lag tradeoffs ]?

- know of any databases that implement this type of logic around their own minting of time-stamped UUIDs?

Prior efforts implementing event-driven backend service with UUID7s minted in client-code seemed perfectly fine at low usage/scale. However, as clients + usage + event-volume scaled, team became more curious about time/timestamp/related issues, and any minting client-side quickly fell out of favor.

Any insights greatly appreciated -- thanks

[ edited b/c i don't know how to format... ]

saagarjha•49m ago
Just use UUIDs as they were meant to be used, as a random identifier. Don't shove random other junk into it!
phoronixrly•45m ago
Wow... That is some nitpicking... The major issue these UUIDs solve for me is the fact that using a random UUID as a primary key of a relational database leads to horrible performance...

It has never crossed my mind to decode the timestamp from them so I save myself a 12-byte column, neither has it crossed my mind to have them monotonic in a distributed system...

hackingonempty•41m ago
> 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.

I thought the main reason UUIDv7 was created with a time component is to keep temporally related rows together in the index pages. Randomly distributed row ids seem OK until the entire index no longer fits in RAM.

skrebbel•36m ago
I feel like this article way downplays the entire point of UUIDv7s, which is that it lets you sort (and store!) your data kinda sorta by creation time, no overlap ever. That's great for cursors, for streaming data, for twitter clones, for chat messages, for player moves, and so on and so forth. Nearly everything that's vaguely realtimey that you might like to both persist and broadcast live to other clients, and displayed in a stable & reasonable order, benefits from a property like this.

In fairness, he does mention this, but squeezes it into a single sentence near the end. But eg the fact that you can't reliably extract the precise timestamp from the UUIDv7 is a feature, not a bug. It's either that or collisions and you don't want the collisions.

roughly•19m ago
Yeah, I think the key here is that you have to know what the limitations are. UUIDv7 does _not_ provide you with sorted and ordered IDs by creation time, it provides you with _kinda sorta_ sorted and ordered IDs by creation time. That's probably fine for a lot of use cases, but if it's not OK for yours (forensic accounting, risk mitigation for banks, whatever), you can't use it for that. You're right it's not a technical problem necessarily, but when the marketing material describes something without an asterisk, people who are unaware that what's being described is impossible at the limits can make bad system design decisions based on that promise.
ForHackernews•36m ago
Most (all?) of these are also true of UUIDv1. Devs in 2026 should be well versed in using UUIDv4 if they really truly can never leak anything.
0x20cowboy•33m ago
As others have said, I don’t think the time was meant to be something you relied on for the object time, but more the help with indexing and sharding.
nitwit005•19m ago
The Python version simply forces the timestamp forward if needed to preserve ordering:

  if timestamp_ms < _last_timestamp_v7:
    timestamp_ms = _last_timestamp_v7 + 1
https://github.com/python/cpython/blob/8d119208074fef0f652f1...

But if you did want "monotonically increasing IDs", as the article suggests, that is what you want.

taylorbuley•14m ago
> the problem is that system clocks cannot be synchronized to a suitable precision.

There are fun conditions under which a quasicrystalline clock could coordinate this in a distributed way. https://en.wikipedia.org/wiki/Time_crystal

adityaathalye•10m ago
alexsci destroyed one of my core assumptions in a bitemporal data system project I've been noodling on. Namely, this oh-so-confident presumption:

Realities are arrows. Time marks flight. UUIDv7 is Time.

(Yes. Yes. No, hell no, not after what Robert just told ya.)

https://www.evalapply.org/posts/poor-mans-time-oriented-data....

The small saving grace for me is that, despite my broken mental model of UUIDv7's time and monotonicity properties, I get to also use SQLite's automatic rowid for ordering and disambiguation. That too, only because I can (still think I can) get away with a "DB per tenant" architecture. Nevertheless, the same breakage potential will return when (not if, when) I have to mix / remix records from two or more DB files.

brb, investigating whether I can reliably construct UUIDv7s using db-time...

mahboi•9m ago
I've never bothered with anything but uuid4. Yes there are special circumstances where something like uuid7 helps because you're sure the timestamp leakage is ok, and you made sure it's not guessable, and you're sure some index performs better with it in a way that matters. I've not been in that situation.

Kimi K3.1 Pro and K3.1 Pro Highspeed

https://www.kimi.ai/blog/kimi-k3-1-pro
273•Jowsey•1h ago•147 comments

Today, we hacked what we'd set out to hack: the iPhone

https://blog.calif.io/p/iphone
412•pavel_lishin•2h ago•251 comments

UUIDv7 doesn't have the properties you think it does

https://alexsci.com/blog/uuidv7-is-weird/
47•ibobev•1h ago•17 comments

Apple Music 404 Not Found

https://music.apple.com/this-url-doesnt-exist
53•frizlab•6h ago•16 comments

Local Wikipedia: Wikipedia, but only for things a half hour walk from you

https://edjefferson.com/localwiki/
1003•sohkamyung•19h ago•195 comments

The Real Kevin Bacon

https://pudding.cool/2026/10/kevin-bacon/
87•xnx•3d ago•28 comments

The Missed Opportunities of Sonic 06

https://isaacmarovitz.com/posts/sonic-06/
36•ibobev•1h ago•3 comments

Canadians are running out of time to oppose Bill C-22

https://www.eff.org/deeplinks/2026/10/canadians-are-running-out-time-oppose-dangerous-c-22-survei...
104•hn_acker•19h ago•31 comments

How Is Music Possible

https://www.henrikkarlsson.xyz/p/music
26•rafaelc•1h ago•13 comments

Show HN: Impossible Machines: declaratively program the physical world

https://www.impossiblemachines.xyz
23•bhaprayan•18h ago•0 comments

Time Nuts (2005)

http://leapsecond.com/time-nuts.htm
17•jacquesm•1h ago•10 comments

Total Historian

https://www.theideasletter.org/essay/total-historian/
11•benbreen•2h ago•1 comments

LISP Comes of Age (1980)

https://microship.com/lisp-comes-of-age/
29•so-cal-schemer•23h ago•10 comments

Docker is weird

https://codeandcake.dev/posts/2026-10-22-docker-is-weird
782•psxuaw•18h ago•317 comments

I turned my TV into a Game Boy Color with a Pokemon town as my home screen

https://twitter.com/robbietilton/status/2111936458923851923
8•scrambled•55m ago•5 comments

Show HN: Swurf – Swipe through the real web

https://swurf.org/
13•webtjb096•11h ago•3 comments

Show HN: Searching for optimal strategies in a puzzle game with chance (Drop7)

https://drop7.dev
4•primitivesuave•1h ago•0 comments

Can we replace a $150k Looker with a bucket of HTML files?

https://david.lequin.dev/blog/bi-software-is-dead/
35•skadamat•1h ago•21 comments

Air Purifiers as White Noise Machines

https://www.jefftk.com/p/air-purifiers-as-white-noise-machines
6•luu•1h ago•0 comments

The foolishness of "natural language programming" (1978)

https://www.cs.utexas.edu/~EWD/transcriptions/EWD06xx/EWD667.html
333•xiaoyu2006•17h ago•222 comments

Ask HN: If the models are so good, why doesn't OpenAI just start 100 companies?

459•ex-aws-dude•21h ago•506 comments

Show HN: OnKey – I'm a bad singer, so I built an app to show where I'm off-key

https://github.com/dsmurrell/onkey
174•dsmurrell•1d ago•74 comments

Gemma-4-26B-A4B with 39-69% less thinking at same accuracy

https://bottlecapai.com/post/thinkingcap-gemma-4-26b/
45•armcat•3h ago•2 comments

Animations for System Builders

https://brooker.co.za/blog/2026/10/23/animations.html
4•KraftyOne•1h ago•0 comments

We have traits at home

https://www.axelmagn.com/blog/202610-zig-traits/
28•Ygg2•19h ago•6 comments

The alien space of science: Coherent but cognitively unavailable directions

https://arxiv.org/abs/2603.01092
180•martincsweiss•1d ago•70 comments

OpenShell – A safe, private runtime for fleets of autonomous AI agents

https://github.com/NVIDIA/OpenShell
482•niemandhier•1d ago•206 comments

How does Fable 5.1 hide messages in images?

https://www.lesswrong.com/posts/WHEQps5PK8LrrcTAb/how-does-fable-5-1-hide-messages-in-images
181•gmays•20h ago•61 comments

An alignment assessment of the UK AISI cybertesting incident

https://www.anthropic.com/research/alignment-assessment-ukaisi
10•olwmc•3h ago•1 comments

LLMs are making formal software verification feasible at a much larger scale

https://www.anthropic.com/research/formal-verification
429•johnbender•19h ago•264 comments