News for hackers. Stuff that matters.
Re:Stop putting AUTO_INCREMENT ids in URLs by nraynaud on Wednesday November 05, 2014 @07:23AM (#8561460)
on the other hand, I'm currently using quite random IDs (firebase), and the URLs are just ugly: /jobs/-J_wBsKY4Rn1WgMPB7-_/operations/-J_wBsKf4-WYh9ohK7j8
Re:Stop putting AUTO_INCREMENT ids in URLs by mnw21cam on Wednesday November 05, 2014 @07:39AM (#8561504)
You don't have to have a massive random number - just one long enough to fulfil your goal. You then ensure uniqueness using your database. If your goal is just to allow sufficient addressability, then the random number needs to have enough bits to cover the maximum number of items you can ever conceive of creating. If your goal is to prevent people from typing in a random number and getting a valid page, you need to multiply your address space by 1/(acceptable probability of guessing).

Having two levels of random number is unnecessary - you should be able to access a job/operation combination with a single identifier.

Re:Stop putting AUTO_INCREMENT ids in URLs by nraynaud on Wednesday November 05, 2014 @07:45AM (#8561520)
In this case, there is also distributed ID generation.