8

I want to begin implementing user functionality on my website, but I'm not sure exactly what kind of information I should be storing. Obviously the basic things like username, password, password hash, real name, email, etc..., but what are some other things that might be useful to know about the user, in a general sense? (I've been tossing around things like last login, login location)

6

This is what I recommend for absolute, must-have fields in a users table:

Is there a standard implementation of a Users Database?

Things like last login, login location, login IP, etc. are better served in a historical table where you can run inserts and then query against the table if you need information. The idea is to have infrequent updates in a heavily used table, like users. Purge old records as necessary.

0

In my opinion (and experience) you can lay out a nice laundry list of data that should be persisted in the database, but no matter how much thinking you do and talking to professionals, half way through the project you're going to find another half dozen pieces of data that you want to keep. Get to a good point and start it up. Then make appropriate changes when necessary.

Good luck! Authentication/authorization is very very fun stuff when it comes to databases.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.