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 > General > Database Concepts & Design > Do big companies like youtube do it like this ?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-02-08, 12:07
coldgarb coldgarb is offline
Registered User
 
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 ?
Reply With Quote
  #2 (permalink)  
Old 03-02-08, 13:22
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,524
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

__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #3 (permalink)  
Old 03-02-08, 13:40
coldgarb coldgarb is offline
Registered User
 
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
Reply With Quote
  #4 (permalink)  
Old 03-02-08, 14:30
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,524
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
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #5 (permalink)  
Old 03-02-08, 23:14
coldgarb coldgarb is offline
Registered User
 
Join Date: Mar 2008
Posts: 3
Thank you very much for your answers
Reply With Quote
  #6 (permalink)  
Old 03-03-08, 13:43
loquin loquin is offline
Super Moderator
 
Join Date: Jun 2004
Location: Arizona, USA
Posts: 1,797
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

Reply With Quote
  #7 (permalink)  
Old 03-03-08, 14:15
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,524
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
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
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