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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.