I’m getting a lot of collisions, at least 5 on the last 100.000 generated UUID. Right now wea are checking that generated UUID with a redis instance, so if a collision happen, we can regenerate it.
The service has at least 2 instances always running.
the UUID is generated with
crypto.randomUUID()
2
Answers
I can only asume they are looking at this method and it does not allow a seed parameter.
I am not sure why this would happen but might have been coincidence that 5 ids were repeated. I suggest looking at other options people have tried, such as including
date.now()
in order to truly never get a repeat.In UUID’s npm page shows support only up to node 14, is that the problem? https://www.npmjs.com/package/uuid