-
Notifications
You must be signed in to change notification settings - Fork 9
Treat UUID like a black box #28
Comments
The goal of these new UUID versions is to provide lexicographically sortable Universally Unique Identifiers. To disallow extracting information from a UUID it should be encrypted or hashed in a way and you wouldn't be able to lexicographically sort them by creation date, otherwise any representation of a UUID is readable.
I'm not sure I quite understand what you mean by this. Do you mean |
I did not mean any encryption or hash creation or other technical measures. I only meant a ban for data extracting in the text of RFC.
OK. But it is better to replace the unclear word node with randomness.
The UUIDs themselves of any versions are actually fully compatibile, because they are of the same lenght, and they are globally unique and indexable in DB. There is actually no need for distinguishing between versions, because UUIDv7 must be treated like a whole black box and the parsing of UUIDv7 must be banned.
No. I mean that values '589e3', '589e4', '589e5' etc. (as well as '589e', '589f', '589g' etc.) can be used as record selection criteria for database shards. |
I totally agree that we could drop the word 'node' and use something else like 'random', but version and variant are mandatory for RFC-4122. These fields are important to separate UUID types into different namespaces (or keyspaces?) so they never collide.
Two RFC-4122 UUIDs of different versions are binary compatible. But I don't agree that non-RFC-4122 UUIDs are compatible with RFC-4122 UUIDs, even though they have the same bit length.
Do you mean Tomas Vondra's Sequential UUIDs? I think it's an excellent candidate for UUID version (UUIDv9 maybe?). In this type of UUID, it's not possible to extract the creation time due to the small bit length (16 bits). So it works like a opaque or black box UUID. Github Repo: https://github.com/tvondra/sequential-uuids |
Ver and var are not mandatory for RFC-4122. Just look at specification of UUIDv4. UUIDs will never collide thanks to random parts regardless of ver or var.
No. I only mean that left parts of UUID of arbitrary lenght can be used for grouping of records and for filling of database shards. |
I don't know if 'mandatory' is the correct word (my English is poor). But that's what I understand from section 4.4. of RFC-4122.
Sorry. I mean UUIDs with different versions never collide, i.e., a UUIDv1 don't collide with UUIDv4. They are in different 'spaces'.
Maybe it can be a use case for UUIDv8 (the catch all version). |
You are correct. ver and var are used in UUIDv4. Nevertheless nothing prevent us from amendment of RFC-4122 that eliminate the outdated requirement of ver and var for new versions of UUID. The database shard on left part of UUID is a possible for any version of UUID, because any version of UUID is sortable. |
Entirely agree. The UUID should be used as a unique identifier and not as a timestamp (MAC address, etc) storage. IMO clause "4.4.4.2. UUIDv7 Decoding" should be changed to something like this:
|
Yes. UUIDv7 should be treaded as a btree-friendly and sharding-friendly (partitioning-friendly) variant of UUIDv4. |
The term At a glance I don't see any place where
|
Please note that people take terms as is, without reading in depth. So the terms should be used in their natural meaning. I've never heard that node means random. |
Everything prevents this! Redefine how the |
No UUIDs will collide thanks to random parts (node) of UUIDs. |
This doesn’t make sense. Take any UUID of any version, change the version (to a valid version #), and you still have a valid UUID. Any randomly set bits will have a non-zero chance of colliding with those same bits in a different-version uuid. Thus, … but maybe I misunderstand your point. Can you provide a concrete example? |
That's not true. Random does not guarantees uniqueness it decreases the probability of collision. Microsoft used to create UUIDv1 when In short, if you generate a v1 |
It doesn’t make sense to demand probability of collision between versions less than between UUIDs of the same version. By the way, the 160-bit UUID will never collide 128-bit UUID regardless var or ver. |
Maybe I'm wrong but as far as I know, this project wants to extend RFC4122 and not redefine it. If you think you could create a better definition and finalise it as an RFC to be a standard then you should create a different draft not tight to RFC4122. |
I see that this project attempts to improve ugly RFC-4122 and overcome the outdated restrictions. And it's much easier to add amendments than create a new RFC. |
Treat UUID like a black box:
The text was updated successfully, but these errors were encountered: