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)
What are some common and useful fields for a users table in a database
database-design
Related Question
- How to segment account info and profile info
- Mysql – Supertypes and subtypes
- Mysql – Design for user profile information and track changes
- Best way to model a single user with multiple usernames
- NoSQL or RDBMS for a Giant Lookup Table
- Mysql – “Centralising” a “decentral” design
- Mariadb – the preferred / common way to separate “access-tokens” in a database design
Best Answer
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.