nloding Posted September 23, 2006 Share Posted September 23, 2006 I'm sure this has been discussed in the past, but I can't find any old threads. I can't find much Googling either, just some ColdFusion junk that I wasn't interested in. Here's the question(s):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!--Nathan Quote Link to comment https://forums.phpfreaks.com/topic/21747-database-design-ala-myspace/ Share on other sites More sharing options...
newb Posted September 23, 2006 Share Posted September 23, 2006 oh god, another social networking site...sigh... Quote Link to comment https://forums.phpfreaks.com/topic/21747-database-design-ala-myspace/#findComment-97087 Share on other sites More sharing options...
nloding Posted September 23, 2006 Author Share Posted September 23, 2006 Heh, actually not. It's NOTHING like MySpace or Friendster in it's actual application. It's a site devoted to a certain clique of people, all of whom share one thing in common. Picture a MySpace only for Star Wars freaks -- it'd be something like that. And it's point isn't really "social networking" ...But regardless, the database design has the same needs at MySpace or Friendster ... hence my question. Quote Link to comment https://forums.phpfreaks.com/topic/21747-database-design-ala-myspace/#findComment-97104 Share on other sites More sharing options...
neylitalo Posted September 23, 2006 Share Posted September 23, 2006 I'm getting heartburn just thinking about the poor server. Literally. Database design rule #82: Never dynamically create tables. Emphasis on never.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. Quote Link to comment https://forums.phpfreaks.com/topic/21747-database-design-ala-myspace/#findComment-97188 Share on other sites More sharing options...
448191 Posted September 23, 2006 Share Posted September 23, 2006 [quote author=neylitalo link=topic=109152.msg439878#msg439878 date=1159004184]...Database design rule #82:....[/quote]LOL, is that a random number or from a book? :PMe hungry fro resources. :P Quote Link to comment https://forums.phpfreaks.com/topic/21747-database-design-ala-myspace/#findComment-97203 Share on other sites More sharing options...
nloding Posted September 23, 2006 Author Share Posted September 23, 2006 Alright, I'll do some digging to foreign keys, which is something I know about but haven't had to utilize yet.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? Quote Link to comment https://forums.phpfreaks.com/topic/21747-database-design-ala-myspace/#findComment-97224 Share on other sites More sharing options...
neylitalo Posted September 24, 2006 Share Posted September 24, 2006 [quote author=448191 link=topic=109152.msg439895#msg439895 date=1159007795][quote author=neylitalo link=topic=109152.msg439878#msg439878 date=1159004184]...Database design rule #82:....[/quote]LOL, is that a random number or from a book? :P[/quote]No, I just kinda made it up, no books involved. :) Quote Link to comment https://forums.phpfreaks.com/topic/21747-database-design-ala-myspace/#findComment-97661 Share on other sites More sharing options...
Barand Posted September 26, 2006 Share Posted September 26, 2006 #82? I'm surprised it's that far down the list. Quote Link to comment https://forums.phpfreaks.com/topic/21747-database-design-ala-myspace/#findComment-99145 Share on other sites More sharing options...
newb Posted September 26, 2006 Share Posted September 26, 2006 [quote author=Barand link=topic=109152.msg441915#msg441915 date=1159296685]#82? I'm surprised it's that far down the list.[/quote]im not. Quote Link to comment https://forums.phpfreaks.com/topic/21747-database-design-ala-myspace/#findComment-99152 Share on other sites More sharing options...
neylitalo Posted September 26, 2006 Share Posted September 26, 2006 oh, come on Barand... it was a joke and you know it. :'(On a similar-but-unrelated topic, I just heard there's candy down the hall. Quote Link to comment https://forums.phpfreaks.com/topic/21747-database-design-ala-myspace/#findComment-99172 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.