Re:Fast ID Generation
by jondot on Wednesday April 18, 2012 @09:38AM
(#3857836)
You present very valid arguments.
Regarding UUID v1, refer to spec in section 4.5.
"Node IDs that Do Not Identify the Host". In the case of generating IDs, I don't care about the device's MAC or allowed block of addresses to use, so I can make a better use of that. Some implementations of UUID v1 uses random jitter which is what I believe is up to date and useful for this case.
In some cases not allowing the number of bits is a hard constraint.
In other cases you'd want to generate a TimeUUID (Cassandra) and take down 2 goals in one strike.
Regarding UUID v1, refer to spec in section 4.5. "Node IDs that Do Not Identify the Host". In the case of generating IDs, I don't care about the device's MAC or allowed block of addresses to use, so I can make a better use of that. Some implementations of UUID v1 uses random jitter which is what I believe is up to date and useful for this case.
In some cases not allowing the number of bits is a hard constraint.
In other cases you'd want to generate a TimeUUID (Cassandra) and take down 2 goals in one strike.
Eventually, in the second part, I pick generating a TimeUUID with simple_uuid (which uses jitter, https://github.com/ryanking/simple_uuid/blob/master/lib/simp...) exactly per your conclusion.
The goal of this part of the post was to present the problems this kind of thing presents :)