LB: UUIDv7 is time ordered, sortable, and has good key locality. Just use those, and you won't even miss your autoincrement keys
-
LB: UUIDv7 is time ordered, sortable, and has good key locality. Just use those, and you won't even miss your autoincrement keys
-
@jenniferplusplus omg, it's literally "v4 but with all the stuff you wish v4 had."
-
@joshuaelliott you do give up like 40 bits of entropy. But that still leaves you with more than 60 bits of entropy, and it turns out that's plenty for virtually every scenario.
-
smallcircles (Humanity Now 🕊)replied to Jenniferplusplus last edited by
@jenniferplusplus @joshuaelliott
I got confused in all the variations, but there was a recent article giving a good summary, and then discussed on HN: https://news.ycombinator.com/item?id=41350225
I got to v7 as well from that list.
-
Benjamin Sonntag-King 🐙replied to Jenniferplusplus last edited by
@jenniferplusplus is it though?
I read (don't remember where) that v7 being ordered makes it (a bit) harder for B-Trees in sgbd tables... -
Jenniferplusplusreplied to smallcircles (Humanity Now 🕊) last edited by
@smallcircles @joshuaelliott
Basically, v4 is enormous entropy, completely unordered, collisions statistically cannot happen within the lifetime of the universe, use when you have an absolutely enormous number of records (trillions+) in the same name space.v7 is high entropy and time ordered, collisions are mathematically impossible after 1 millisecond. Use when records close together in time are likely to be queried together, or if you need keys that have a stable meaningful ordering.
-
Jenniferplusplusreplied to Jenniferplusplus last edited by
@smallcircles @joshuaelliott the rest are mostly not very useful
-
smallcircles (Humanity Now 🕊)replied to Jenniferplusplus last edited by
@jenniferplusplus @joshuaelliott
useful advice, thanks!
-
Jenniferplusplusreplied to Benjamin Sonntag-King 🐙 last edited by
@vincib being closer in value means they should cluster into fewer larger buckets, so you do less tree traversals and you can get them in sequential memory pages more often. I'm not sure how being ordered affects things, but my understanding is the access characteristics due to the narrower distribution makes a big difference
-
Jesse Cookereplied to Jenniferplusplus last edited by
@jenniferplusplus this is where I was landing and then I saw https://github.com/paralleldrive/cuid2 a few days ago. I'd be curious to hear your thoughts.