Re:Ask HN: We just had an actual UUID v4 collision...
by erikerikson on Friday May 08, 2026 @07:12PM
(#48069911)
There are better approaches like pre -avoiding collisions but generating tends to be more expensive than checking.
[ Parent
| on HN ]
Re:Ask HN: We just had an actual UUID v4 collision...
by orf on Friday May 08, 2026 @07:14PM
(#48069932)
In what world is generating a UUID more expensive than checking for duplicates? at any scale?
Walk me through that please
Re:Ask HN: We just had an actual UUID v4 collision...
by erikerikson on Friday May 08, 2026 @07:18PM
(#48069963)
Yeah, that was a little sloppy but it's generating is more expensive than not generating. In more words, generating an id and validating uniqueness is more expensive than only validating uniqueness.
Re:Ask HN: We just had an actual UUID v4 collision...
by soni96pl on Monday May 11, 2026 @05:39AM
(#48092898)
UUID is used where checking is difficult, think distributed devices offline at a plantation. How could checking be easier in that case? It would require infrastructure that doesn't exist. There are many other cases where it's easier to handle collisions.
Re:Ask HN: We just had an actual UUID v4 collision...
by erikerikson on Monday May 11, 2026 @09:46AM
(#48094950)
Agreed. While it's an uncommon scenario it is a significant case and UUID shouldn't be used in that case because as you write checking doesn't work well. Better to use an alternative such as coordinate/reserve monotonic producer IDs that get paired with monotonic, per-producer monotonic sequence IDs to produce guaranteed unique, well-ordered IDs.
[edit: in IOT it's common to issue x509 certificates as a type of authentication which could be used instead of using producer IDs. Solutions always have to be paired to use case.]
Re:Ask HN: We just had an actual UUID v4 collision...
by tommoneytools on Monday May 11, 2026 @05:42AM
(#48092912)
Wild edge case. Curious if they ever found the root cause.
Re:Ask HN: We just had an actual UUID v4 collision...
by erikerikson on Monday May 11, 2026 @09:49AM
(#48094987)
Welcome to Hacker News.
I suspect you meant to reply to a different comment. Regardless the most plausible speculation I've read here is that the RNG used to generate the UUID is low quality.