Hacker News new | ask | show | jobs
by JoshTheGeek 4247 days ago
Couldn't you generate a UUID and then check the database that it is unique before using it? You could then repeat until you got a unique identifier.
1 comments

UUIDs have the advantage that no coordination is required. With a database you will create coordination problems as you scale up your system.

I have either a high or total assurance that any UUID I self-assign has never been used anywhere, ever, for anything else, by anyone else, in any system.

In fact, the odds that I will have a collision with another UUID are lower than a cosmic ray striking a computer at the moment when it is performing the uniqueness check.