If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > myspace type DB for managing friends

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-14-06, 13:38
DMS DMS is offline
Registered User
 
Join Date: Aug 2006
Posts: 2
myspace type DB for managing friends

I'm working on a project that will have a similar DB to how myspace manages friends.

I'm trying to determine the best way to build this out, as one user could potentially have hundreds of thousands of friends...

Would it be best to create an ID table that simply holds the UserID and the UserID of the friend? OR would it be best to just use longtext and hold all friends UserIDs in an array for a paticular user?

Any help would be great... thanks!
Reply With Quote
  #2 (permalink)  
Old 08-15-06, 09:02
allera allera is offline
Registered User
 
Join Date: Aug 2006
Posts: 1
I would think that using a string that you later must parse and sort would be too intensive on any system. Instead, let the database do what it does best -- store, sort, and index data. I've never done it before, but if you use two columns (for each userid), you could also inherently store which friend made the friendship request (FromFriend, ToFriend). You can even put a status column to indicate what stage that friendship is in (requested, accepted).

Hope that helps somewhat.
Reply With Quote
  #3 (permalink)  
Old 08-15-06, 09:51
DMS DMS is offline
Registered User
 
Join Date: Aug 2006
Posts: 2
Quote:
Originally Posted by allera
I would think that using a string that you later must parse and sort would be too intensive on any system. Instead, let the database do what it does best -- store, sort, and index data. I've never done it before, but if you use two columns (for each userid), you could also inherently store which friend made the friendship request (FromFriend, ToFriend). You can even put a status column to indicate what stage that friendship is in (requested, accepted).

Hope that helps somewhat.
Very true... thanks!
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On