In a website users can register through different social logins ex: facebook, google, github etc in addition to normal email registration.
There is one users table to store these users, and in addition is needed a mapping to check if a user comes from 3rd party logins or not.
- One solution to store the users can be in one table in which the design is as follows: id (int), provider_user_id (string), provider (string)
Id is internal user id in your system provider_user_id is the id of the user in the provider system Provider can be facebook, google etc
- The second solution is to keep separate tables, ex: facebook_users and there have id(int) facebook_user_id(string)
You do the same thing for all providers (one table for each).
Which approach do you like better and why ?