New UUID Formats
(www.ietf.org)
from agilob@programming.dev to programming@programming.dev on 30 Jun 2024 13:48
https://programming.dev/post/16241922
from agilob@programming.dev to programming@programming.dev on 30 Jun 2024 13:48
https://programming.dev/post/16241922
This document presents new time-based UUID formats which are suited for use as a database key.
threaded - newest
Isn’t that relatively old news? I’ve been using them in Symfony for a few years, already.
Publish was 2021 so yeah a couple years old
Why did you post a 3 year old expired draft whose proposed implementation has been obsoleted?
Upvotes
For others wondering what’s wrong with UUIDv4:
I guess, this means with these new UUIDs, ideally you only create UUIDs on systems that are hooked up to NTP, though I guess, it won’t really be worse than UUIDv4 either way.
My understanding is that as long as IDs are roughly the same range of the index instead of literally random, it reduces the thrashing about needed for indexing these. It probably doesn’t need to be perfectly exact. They’re talking about B-trees, so these would all be modifying the same smaller branches of the tree instead of going in all over the place.
Yeah, that is my understanding, too. Otherwise you’d only want to generate them on the database host, as even with NTP there will be small differences. This would kind of defeat the purpose of UUIDs.
If you’re saying that even without NTP, just by manually setting the time, things will be fine. I mean, maybe. But I’ve seen it far too many times already that some host shows up with 1970-01-01…
Haha, that’s fair, someone absolutely would manage to write 1970s dates if they aren’t pulling the current time.