5
New UUID Formats (www.ietf.org)

This document presents new time-based UUID formats which are suited for use as a database key.

top 8 comments
sorted by: hot top controversial new old
[-] unmagical@lemmy.ml 28 points 5 months ago

Why did you post a 3 year old expired draft whose proposed implementation has been obsoleted?

[-] 555_1@lemmy.world 0 points 5 months ago
[-] Ephera@lemmy.ml 6 points 5 months ago

For others wondering what's wrong with UUIDv4:

UUID versions that are not time ordered, such as UUIDv4, have poor database-index locality. This means that new values created in succession are not close to each other in the index; thus, they require inserts to be performed at random locations. The resulting negative performance effects on the common structures used for this (B-tree and its variants) can be dramatic.

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.

[-] barsquid@lemmy.world 6 points 5 months ago

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.

[-] Ephera@lemmy.ml 2 points 5 months ago

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...

[-] barsquid@lemmy.world 2 points 5 months ago

Haha, that's fair, someone absolutely would manage to write 1970s dates if they aren't pulling the current time.

[-] rikudou@lemmings.world 3 points 5 months ago

Isn't that relatively old news? I've been using them in Symfony for a few years, already.

[-] breadsmasher@lemmy.world 2 points 5 months ago

Publish was 2021 so yeah a couple years old

this post was submitted on 30 Jun 2024
5 points (55.8% liked)

Programming

17314 readers
509 users here now

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you're posting long videos try to add in some form of tldr for those who don't want to watch videos

Wormhole

Follow the wormhole through a path of communities !webdev@programming.dev



founded 2 years ago
MODERATORS