I'm planning to do this for my application:
- Store a unique id into key_name of a User model.
- At any time given, user will be allowed to choose a username once, which I intend to replace the original key_name of a model with this username chosen by user.
- With my implementation, any new user, the User model will be only created when user is activated.
Based on the situation, my question, which of the following a better approach ?
- Upon user log in, user must choose a username, so that I could create the User model with the keyname = username chosen. However, this approach might appears unpleasant to user as they should be allowed to choose username anytime that they wanted to.
- The approach explained in situation above, however I would need to do clone_entity. However, with clone_entity, will reference properties be assigned back to the new cloned entity ? And also, performance is priority, will this be costly in terms of database operations if it involves a lot of users at the same time ?