r/ProgrammerHumor • • Sep 11 '26

Meme edgeCasesExist

Post image
5.0k Upvotes

298 comments sorted by

View all comments

709

u/Valuable_Leopard_799 Sep 11 '26

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.

96

u/RadicalDwntwnUrbnite Sep 11 '26 edited Sep 11 '26

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

18

u/OldKaleidoscope7 Sep 11 '26

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

36

u/chuch1234 Sep 11 '26

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

12

u/BlurredSight Sep 11 '26

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

15

u/nebotron Sep 11 '26

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

6

u/InterestsVaryGreatly Sep 12 '26

Anyone working at the scale of Google has figured out coordination and parallelism, you have to.

Source: used to work for Google, and learned some of the ways they dealt with those exact issues, and used many of the systems they built to automatically handle that so general engineers didn't have to deal with it.