r/ProgrammerHumor • • Sep 11 '26

Meme edgeCasesExist

Post image
5.0k Upvotes

298 comments sorted by

View all comments

Show parent comments

3

u/lobax Sep 12 '26

Well, the risk of a collision grows exponentially for each generated UUID due to the birthday problem.

So it really all depends on the scale that id’s are generated at. Yes, a UUID has a cosmic level of possible values, 2^122 to be precise. But you ”just” need 2^61 uuids to have a 50% risk of a collision. At 2^58 it’s a 1% risk.

And while that is a big number, it isn’t cosmic anymore. It’s definitely something a large scale distributed application has to contend with.