Considering youtube video url (for example):
e.g. :
http://www.youtube.com/watch?v=-JVkaMqD5mI&feature=related
I'm talking about the -JVkaMqD5mI
part. ( length=11)
lets calc the options :
a-z = 26 |
A-Z = 26 |_______ > 26+26+10+2 = 64 optional chars in 11 places = 64^11 = 73786976294838206464
0-9 = 10 |
-_ = 2 |
Im still wondering , when they generate a new ID for a new video , do they still check if already exists ?
Im sure they have some list( db or cache) of the "already generated ID's" ... ( and if they do , do they aquire the db each time ? or in cache ? or...?)
Or do they rely on the 1.355252...e-20
chances which is almost 0
.( but still !=0)
What is the best practice solutions for this kind of situations ?