Is there a particular reason why you wouldn’t use a natural identifier like an e-mail address?
Currently I use Java’s UUID class to create unique identifiers but for some objects they have a natural key – like a user and their e-mail address. It would make more sense (and make my code cleaner) if I used their e-mail address but I wondered if there was any particular reason you shouldnt?
Thanks
UPDATE
I am using MongoDB in this particular case.
Natural identifiers are often not constant. For example, I’ve updated my email address a few times over the past 20 or so years, yet I’m still the same person. It is reasonable to have an index on the email address column though; after all, people don’t change them very often…