3 ms·
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
by nraynaud 12y ago
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
- mnw21cam 12y agoYou 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.
- nraynaud 12y agoIn this case, there is also distributed ID generation.