I have a User entity in my Google App Engine model, and a user has a name, email, password, and some other stuff. Currently, I use the user’s email as the key to the entity. Up until now, I hadn’t considered what would happen if the user were to change his email.
The reason using email as the key was so convenient is that the client device always knows the users email, and rather than storing and keeping track of some separate user_id, it would be more convenient to just look up by email.
So what if the user does change their email? Is it a big deal after all – is the work to be done trivial? What are some better options for keys for a user?
Use an int/Integer and GAE will assign a key value for you.