3 ms·
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.
by JoshTheGeek 12y 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.
- jacques_chester 12y agoUUIDs 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.