Results 1 to 7 of 7
  1. #1
    Join Date
    Mar 2008
    Posts
    3

    Talking Do big companies like youtube do it like this ?

    I was wondering how big sites like Youtube do this particular thing.

    There you can rate video once and then if you try to rate again it does not allow.

    was wondering how their table structure would be to log who voted for which video

    is it as simple as Userid,VideoId but wont this get really big soon because they have so many visitors?
    Is there a better database design for this ?

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    Quote Originally Posted by coldgarb
    is it as simple as Userid,VideoId but wont this get really big soon because they have so many visitors?
    yes it is and yes it will

    besides having the script for it, they also have the disk space

    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  3. #3
    Join Date
    Mar 2008
    Posts
    3
    i thought the tables may have some row limits , isnt it so ?
    in terms of efficiency is it better to store one user id and one video id per row or just one userid and many comma separated video ids in second column

  4. #4
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    Quote Originally Posted by coldgarb
    i thought the tables may have some row limits , isnt it so ?
    no, it isn't so

    Quote Originally Posted by coldgarb
    in terms of efficiency is it better to store one user id and one video id per row or just one userid and many comma separated video ids in second column
    the former, by a very large margin of difference in performance
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  5. #5
    Join Date
    Mar 2008
    Posts
    3
    Thank you very much for your answers

  6. #6
    Join Date
    Jun 2004
    Location
    Arizona, USA
    Posts
    1,848
    Does youtube do something as simple as setting a cookie when you vote? That way, the storage requirement falls on the user's machine...
    Lou
    使大吃一惊
    "Lisa, in this house, we obey the laws of thermodynamics!" - Homer Simpson
    "I have my standards. They may be low, but I have them!" - Bette Middler
    "It's a book about a Spanish guy named Manual. You should read it." - Dilbert


  7. #7
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    yes, they do set a cookie, go have a look on your C drive (holler if you don't know where to look, and please mention what browser you're using)

    the only thing stored in my youtube cookie (i do not sign on when i visit) is data in the following categories:

    - VISITOR_INFO1_LIVE
    - LOCALE_PREFERENCE
    - GEO

    you do realize that youtube lets you vote on thousands of images, and yet there is a limit to both the size and number of cookies that your browser will support
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •