4 ms·
Can UUID v7 still be created independently, on a client for instance? Or do they ideally need to be generated in the same place?
by jamil7 3y ago
Can UUID v7 still be created independently, on a client for instance? Or do they ideally need to be generated in the same place?
- jayknight 3y agoThey can be generated anywhere, otherwise they wouldn't be universally unique.
- jamil7 3y agoI'm not asking about the uniqueness but about ordering across different clients.
- roenxi 3y agoThere is probably an impossibility theory somewhere for two clients generating ordered ID without communicating with each other. What if one client was travelling near the speed of light for example? It isn't obvious what order would be correct since the two clients would have wildly different perceptions of time.
- ahoka 3y agoYes, it’s impossible in theory. Same as the two generals problem, if I’m not mistaken.
- sibit 3y agoIf they're generated on the client you would need to keep clock drift[0] in mind since the leading bits are time based. [0]: https://youtu.be/mAyW-4LeXZo https://youtu.be/mAyW-4LeXZo (Clock Synchronization in Distributed Systems by Martin Kleppmann)
- stevesimmons 3y agoYes, UUID v7 can be generated independently. The UUID has three parts, which maintains strict chronological ordering for UUIDs generated in one process, and to within clock skew when UUIDs are generated on different systems. The three parts are: - time-based leading bits. - sequential counter, so that multiple UUID 7s generated very rapidly within the same process will be monotonic even if the time counter does not increment. - enough random bits to ensure no collisions and UUIDs cannot be guessed.
- jamil7 3y agoThank you.
- westurner 3y ago> There are new UUID formats that are timestamp-sortable; for when blockchain cryptographic hashes aren't enough entropy. Note that multiple rounds of cryptographic hashing is not considered sufficient anymore; PBKDF2 and Argon2 are Key Derivation Functions, and those are used instead of hash functions. "New UUID Formats – IETF Draft" https://news.ycombinator.com/item?id=28088213 https://news.ycombinator.com/item?id=28088213 draft-peabody-dispatch-new-uuid-format-04 Internet-Draft "New UUID Formats" https://datatracker.ietf.org/doc/html/draft-peabody-dispatch-new-uuid-format https://datatracker.ietf.org/doc/html/draft-peabody-dispatch... ; UUID6, UUID7, UUID8
- jongjong 3y agoI don't have a problem with UUIDv7 but I wish they had created it as a completely separate standard after UUIDv4... The version number increases imply that previous versions have been superseded but in fact, they just have different priorities... And TBH I'm concerned that UUIDv1 had a timestamp, then it was removed completely in UUIDv4 and now the timestamp concept is being added back to UUIDv7... There are legitimate use cases where you simply don't want to have timestamps in your IDs.
- ahoka 3y agoThese are not versions in the sense that one supersedes the other. More like variants.
- jongjong 3y agoI hope devs and security consultants will see it that way. I can easily envision a future where security consultants would write reports flagging systems as 'unsecure' on the grounds that they use 'an outdated UUID version'. Security consultants can be quite blunt in their approach and companies will often yield to their every demand for the sake of easy compliance and to avoid having to explain stuff.