Database design ala MySpace
Posted 23 September 2006 - 01:22 AM
If one were designing a social networking site, what is the best approach?
a) Each user gets their own tables (i.e., 1 blog table per user, 1 profile table per user)
b) Every X users, a new table is created (x = 10, so every 10 users is a new table for each blog, profile, etc.)
c) One HUGE table for each category with each user as a row.
d) Some combination of both -- like, one giant table for all profiles, but each user has their own blog table.
I'm in the beginning stages of designing a site that is actually quite complicated. Here's a brief outline:
Each user has a unique login -- each login is linked to several "characters" -- each character has their own profile like MySpace, Facebook, Friendster, etc -- each profile has friends, blogs, photos, calendars, etc. At first, this site won't have too many users, but we are expecting up to 10,000.
So ... what do you all think?
You guys are very helpful, thank you in advance for everything!
Posted 23 September 2006 - 03:36 AM
But regardless, the database design has the same needs at MySpace or Friendster ... hence my question.
Posted 23 September 2006 - 09:36 AM
The basic idea: create a table user, a table blog, a table profile.
Each time a user is created, add a row to user. Add a row to profile where one of the fields in profile is an ID that matches up with the ID in user. Therefore, the content in profile is linked to the user.
Each time a user makes an entry in their blog, add a row in blog with the information, and link an ID field in blog to the ID field in user.
And that, my friend, is the basic idea.
Posted 23 September 2006 - 10:36 AM
...Database design rule #82:....
LOL, is that a random number or from a book?
Me hungry fro resources.
Posted 23 September 2006 - 12:57 PM
Now, is there an sort of organization that should go into, say, the blog end of it? Obviously the user can have as many blog entries they want -- and I assume each entry is it own row in the blog table, with the user ID being a key. Just randomly add the rows down the table as the users enter data?
Posted 26 September 2006 - 06:51 PM
Donations gratefully received
|baaGrid| easy data tables - and more
|baaChart| easy line, column and pie charts
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users