Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

But the uuid collision chance only matters if there is even a possibility of colliding writes and lookups.

So what if your microblogging platform's tweet uuid happens to collide with my cocktail recipe generator's ingredient uuid? The likelihood that any one device will ever be running our apps at the same time and trying to read data from one into the other is even smaller than the 1-in-380000000000000000000000000000000000000 (uuidv4) probability of having a collision in the first place.



You're right, but why would either of us be using UUIDs for that purpose, when an auto-incrementing integer would suffice?


Because incrementing integers require a singular central node to track the universal state and even so still have a risk of collision bucause they are not guaranteed to be unique in absence of an externally carefully managed master incrementer.

Applications use uuids to avoid colliding with themselves. Uuids exist so that web-apps can create objects client-side without waiting for a database CREATE, applications can be built with multi-node dbms, operating systems can name hardware compenents.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: