Jump to content

comments on page


sfx81

Recommended Posts

They probably use a database, and each comment has it's own row in a "comments" table, and one of the columns is "videoID", and when the video loads, it selects the comments where videoID = the ID of the video selected. I guess, anyway.

Link to comment
Share on other sites

but in this way they have to keep a seperate table for each video, with comments and userid etc... Isnt there any performance issue with reading and writing to 100's and 1000's of tables at same time, and number of connection made to db etc...

Link to comment
Share on other sites

Looks something like this, obviously i left out fields, but you'll get the point.

 

Video table:

video_id    |       title       |      url      |

32                  Rick Rol..       q28af8   

33                  The cat..       329af8   

34                   Born to ..       259d93 

 

 

Comment Table:

comment_id |    video_id      |   comment

1                     32                  omgz epic!

2                     32                  yes omgz epic!

3                     33                  thats a fat cat

 

Notice how the video_id in the comment table links to the video_id in the video table.

Link to comment
Share on other sites

youtube has insane servers. They're, at any second, playing millions of videos(and hosting many more than what are currently playing). But yea, they have a Video table and a Video_Comment table, with a video key that references the video it's commenting on. Not hard to design. Very simple actually

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.