I was wondering what the benefits of using user IDs were, rather than just using a unique username for keys.
- user: USERNAME => {password: HASH, age: 45}
- user: 0 => {username: USERNAME, password: HASH, age: 45}
Please note that I would like to search for users by name, so a second set of key values is required to associate user names with identifiers.
Given that each username is unique and must be alphanumeric, is there any special reason why it might be useful to use an identification system.
The main reason I ask about this is because I mostly used identifiers, as they reduced the search time in my database, especially when the database was normalized somehow. But Redis does not get this benefit, and so I wondered what else could be the reasons for using user IDs, not just usernames.
Thanks for any help
Plückerpluck
ps Due to the way Redis handles hashes, I'm not really sure about the memory differences between the two methods, so this information may be good, although I can go and check it later.
source share