3 ms·
>> No guarantee that the ID we'll choose will be unique a few µseconds from now. That's why you let the database atomically create the next id for you. There i
by ExpiredLink 14y ago
>> No guarantee that the ID we'll choose will be unique a few µseconds from now.
That's why you let the database atomically create the next id for you. There is no problem. You either get the next unique id or you have to try again.
- dasil003 14y agoSo the obtuse point your trying to make is that slugs are unnecessary and we should just use an auto-increment or uuid? Sorry, but slugs serve a real purpose, so your solution is only a solution in the sense that walking is a solution for a broken down car.
- codebeaker 14y ago> Sorry, but slugs serve a real purpose, so your solution is only a solution in the sense that walking is a solution for a broken down car. This doesn't replace slugs, at all - the slugs are still generated, this replaces the SQL unique sequencer. The SQL sequencer which isn't universally supported, and has a different API on every platform.. many modern applications have Redis or a similar atomic structure store which could provide an interim solution, short of building a purpose built ticket provisioning system such as that employed by Flickr.