I have read some older answers, regarding generating userids. Do you know if it safe to use timeuuid as a unique identifier? I am planning on using it both for userids and for tokens.
Thanks Regards
I have read some older answers, regarding generating userids. Do you know if it safe to use timeuuid as a unique identifier? I am planning on using it both for userids and for tokens.
Thanks Regards
The UUID and timeUUID are safe to use as unique keys. Documentation on the UUID types describes them as follows:
The UUID (universally unique id) comparator type is used to avoid collisions in column names. Alternatively, you can use the timeuuid.
For more information on how UUIDs work the Wikipedia article outlines the way UUIDs are generated and why they work. This question is strange since the odds of a duplicate TYPE 1 UUID is very low. From the wikipedia entry,
...after generating 1 billion UUIDs every second for the next 100 years, the probability of creating just one duplicate would be about 50%.
This holds true for timeUUIDs.