If you guys ever used Google App Engine. It generates a key for every single instance of a model created. It’s pretty neat.
I’m looking into building something like that. Do they do it so that the key is based on the content? Or do they just take a random choice from a-zA-Z0-9 for like 50 times and build a string out of it? That sounds reasonable because the chances that 2 key would be the same would be lower than 1/10^89.
Just using random values is not going to cut it. While the chance of two keys being the same is very slim the chances increase rapidly with the number of keys generated. See the birthday paradox.
In most cases such keys are generated in a way that guarantees uniqueness by containing several values like MAC address or some serial number of the server that generated it, a time stamp, the value of an special counter.