Post B6fQoucFs5vUvctJ0i by ramsey@phpc.social
(DIR) More posts by ramsey@phpc.social
(DIR) Post #B6fQou87g7p7QAnF2m by whitequark@social.treehouse.systems
0 likes, 0 repeats
UUIDs are so funny today because almost all of their deployments is "we take a string of mostly-random bits but give it structure for no apparent reason"
(DIR) Post #B6fQouOmgB9QFqaY0u by whitequark@social.treehouse.systems
0 likes, 0 repeats
it's true that you could populate some of those bits with predictable sequences to avoid clashing (a la snowflake) but guess what: you can do this to a hex string or a number (as does snowflake). i think the only reason UUIDs are as popular as they are today is Microsoft?
(DIR) Post #B6fQoucFs5vUvctJ0i by ramsey@phpc.social
0 likes, 0 repeats
@whitequark Most applications that use UUIDs these days tend to use version 7 UUIDs, which use milliseconds since the Unix epoch as the most significant bits. This embeds the creation timestamp in the ID and allows for sorting, while also adding in sufficient randomness so they're not incremental and multiple systems can generate them with low probability of collision.
(DIR) Post #B6fQoup16e8PZCrUu0 by whitequark@social.treehouse.systems
0 likes, 0 repeats
@ramsey oh, I didn't know this!
(DIR) Post #B6fQov0iP9Ua9UKq8W by azonenberg@ioc.exchange
0 likes, 0 repeats
@whitequark @ramsey I've only ever seen version 4 (unstructured random) in production that i can recall
(DIR) Post #B6fR1vbnUa47ltsppw by azonenberg@ioc.exchange
0 likes, 0 repeats
@whitequark @ramsey (this is the first I've ever heard of v7)
(DIR) Post #B6fRo29wRLEJzKnD3w by intrbiz@bergamot.social
0 likes, 0 repeats
@azonenberg @whitequark @ramsey V7 is fairly new, standardised around 2024. They've got a bit more adoption in databases over the last year.