简体   繁体   中英

Separating user table and password table?

I'm working on a website that is going to hopefully connect easily with Facebook (and possibly eventually different services) and after reading some different questions about how to handle things like this, a common answer seems to be storing a flag that tells you the authentication for each user (if they log in through facebook or through "normal" login on the webiste).

This makes sense, and its what I was thinking about doing anyways, but now my question is: would it be safe/acceptable to have a separate table to store the password hashes of the normal login users on, or should I just make it so the password related columns in my users table can be left null for facebook users?

I personally would go with null option as its the matter of having just one column. If you have multiple columns then moving to separate table would be better if storage can be of concern. With only one column as in your question, you are not going to have to worry about joins and so on which greatly contributes to query performance.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM