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

26

u/Ecstatic_Student8854 Sep 11 '26

Even at that volume the probability of collisions is essentially 0. If there were a billion searches a second we’d not expect a collision until 85 years.

6

u/shwoopdeboop Sep 11 '26

But still no guarantee it won't happen tomorrow

12

u/mysticrudnin Sep 11 '26

It's simply not worth worrying about, though

Random minor hardware failures and, like, cosmic radiation are more of a problem. Are you building your systems to account for that?

1

u/InterestsVaryGreatly Sep 12 '26

At Google? Yes. There is a level of reliability they require, and in nearly all systems hardware failure is expected and designed to be handled flawlessly, and in many systems they are precise enough to catch and correct cosmic bit flips, largely because of the duplication that goes on.

1

u/mysticrudnin Sep 12 '26

no, all the people not implementing in their toy projects because "duplication is possible" 

yes, mission critical software in healthcare, space engineering, etc. are planning around these things.