3 ms·
Because simple integers are not universally unique, a major feature of UUIDs…
by rco8786 5y ago
Because simple integers are not universally unique, a major feature of UUIDs…
- inetknght 5y agoIs this sarcasm? If you generate an incrementing-UUID then its predictability is going to make it not-universally unique too
- rco8786 5y agoThat is…not what universally unique means.
- rwoerz 5y agoFrom RFC4122: "A UUID is an identifier that is unique across both space and time, with respect to the space of all UUIDs." Hard to achieve if everyone starts from 00000000-0000-0000-0000-000000000000.
- rco8786 5y agoRight that’s why nobody starts at 0. And you don’t have to only add 1 to be ordered, no DB I’m aware of just adds 1 to sequential UUIDs. There’s always randomness/entropy involved.
- ztorkelson 5y agoSequential UUIDs don’t start at 0. They are a 128-bit composite of two integers; a temporal component in the high order bits and a random component in the low order bits.
- michaelmcmillan 5y agoNo. Incrementing an integer might be unique for the local database, but not unique for the universe.
- atq2119 5y agoUUIDs are integers, they just happen to be 128 bits long instead of the more common 32 or 64, and they are usually printed in a specific way that differs from how integers are usually printed. But that's just smoke and mirrors. UUIDs are generally not guaranteed to be universally unique. The name is misleading marketing. If you generate them randomly, then the probability of collision is small enough not to matter, but the more you introduce deterministic elements, like generating them sequentially, the more your probability of collision increases.
- anamexis 5y agoUUIDs are just 128-bit simple integers.