>> 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.
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.
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.