User Accounts

user-accounts.jpg
user-accounts.jpg
sold out

User Accounts

0.00

User accounts tend to rely on fairly straightforward data models. One way of storing user account data in Riak would be store each user’s data as a JSON object in a DeOS bucket called users (or whatever you wish).

Keys for user data objects could be constructed using application-specific considerations. If your application involves user logins, for example, the simplest and most read-efficient strategy would be to use the login username as the object key. The username could be extracted upon login, and a read request could be performed on the corresponding key.

There are, however, several drawbacks to this approach. What happens if a user wants to change their username later on? The most common solution would be to use a UUID-type key for the user and store the user’s username as  a secondary index for efficient lookup.

Add To Cart