difference between User and Account object in social network design?

kei30 picture kei30 · Sep 6, 2010 · Viewed 7.3k times · Source

I am building a data model for a social networking site and lost of how to model Users and Accounts.

1) User signsup and creates an Account. So we assign the User a user Id like on most social websites we see which is same profile ID. Now is that the account ID too? OR is there a separate account ID also hidden? If user can have multiple profiles, then user ID is seperate from account ID which is separate from each profile ID?

2) We assume 1 user has only 1 account. But when a user is editing his account or let's say an admin edits a user's account, then the User is editing an account, so two separate IDs required to model this?

3) What is the life of a user and account object? If user closes his account, that means both the user and account object get killed?

4) And who holds the user profile details, user settings, privacy, friends, etc? The user object or Account object, and which object is superior?

5) There are system objects such as photo, video, etc which a user can create/admin, so are those owned by the user or the account object?

6) What exactly makes an object? Say we have status updates, comments, profile details. Are these 3 objects? Or all considered 1 type of object and just 3 categories?

Answer

d-_-b picture d-_-b · Sep 6, 2010

I understand your point about user vs. profile, but user vs. account?

For most of my designs, that's the same thing. Most of your questions seem to stem from this confusion. Why would you need separate IDs? Why would you differentiate between the two. If you have a need to, then maybe so. For example, maybe you have a user account that spans several services. This user has separate account information on the different services, but the same login. In that case, you'd need to have two separate objects: login (in the authentication system), and account (in the actual application). But I don't think you are creating such a large system. No?

6) If all those cannot be represented in the same code, they will have to be separate objects or derived from a similar object. For example, in some portals I see the PM (private message) system looks like a private forum thread between two or more people. Having not looked at the source, I would imagine then that forum topics/threads are the same or a similar, perhaps derived from the same, object.