Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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)

share|improve this question
Don't store password. Store the hash only. – sqlvogel Jun 29 '11 at 11:34
Also this is similar to the question [… [1]:… – Leah Jul 22 '11 at 8:51
Django project's auth system has a reasonable default. By definition this was built for the "general" sense. – User Oct 27 '12 at 21:16
@sqlvogel True, but don't forget the salt (said from the far side of a long table), and use something better than md5 or sha-1. – Anthony Rutledge Oct 11 '15 at 23:25
up vote 5 down vote accepted

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.

share|improve this answer

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.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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