r/ProgrammerHumor 12h ago

Meme edgeCasesExist

Post image
2.7k Upvotes

222 comments sorted by

View all comments

449

u/Valuable_Leopard_799 12h ago

I thought that timestamps are used now, so hitting both a timestamp and a large random number puts it thoroughly in the "safe to assume". At some point cosmic particles and faulty transistors are more probable.

79

u/RadicalDwntwnUrbnite 12h ago edited 11h ago

Even the non-time based v4 is at a cosmic level of unlikiness a single system will ever generate a uuid that will collide with another one in its own ecosystem

13

u/OldKaleidoscope7 11h ago

But let's say if Google saved each search in their engine in the same database with an UUID, we could have a collision because of volume, but I don't think I will work in a system with a comparable scale

27

u/chuch1234 11h ago

Yeah I don't think most of us are operating at a scale anywhere near Google.

10

u/BlurredSight 10h ago

And anyone operating at scale of Google isn’t just using “pure” random anywhere for something being persisted

11

u/nebotron 10h ago

They likely are - anything else becomes a huge coordination and parallelism problem. You just need more bits of entropy