Jump to content

friends system question


fife

Recommended Posts

I have just a general question about a friends system here with regards to the database design.......

 

lets say you have a website where users can rent books.  The database design would be

 

 

MEMBER                                    BOOK                                                              LINk

memberid                                  isbn                                                                memberid

name                                        name                                                              isbn

                                               

Or something to that extent

 

Now with a friends system like facebook has that "LINK" table would be absolutley huge and I cant see it being good design practise.  I mean how do you suppose facebook does this. Do they have ......

 

FRIENDS

myID

friendID

 

 

and just millions upon millions of repeated data?

 

The only way I can see would be in the member table have a field called friends and then the ID's of each friend like so

 

 

Friends

001, 002, 003, 004, 005, 006, 007,

 

Now is my logic correct here or am I thinking of this totally the wrong way?  Would the other way be a better option or would it take the system too long to get to the 1000,000 th record in the database?

 

I believe the first option would be correct but I cant see how the server would handle the request if say you had 1000,000 users.  It just seems to me that you would create too many records. 

 

In my website people can sign up to mulitple events but if every user had 100 events the link table would just be massive!!!!!!!!!!!!!!!!!!!!!!

 

Im just after peoples input really on the situation.

 

Thank you

 

 

 

 

 

 

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/230912-friends-system-question/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.