Jump to content

Recommended Posts

Hi.

 

So, was thinking about stuff, and so on, when i tryed to understand how the backend of something like the hi5 profile voting would work.

Basically, we have a member, wich profile other members can vote on, once. How to keep track of that?

I found someplace saying that the amount of members is 50 millions.

So, i assume that having a 'pre-made' DB with yes/no for votes for each of the other members, is... not quite possible  :P

But, making a record for each vote, also gets some quite large numbers. Assuming only 10% of the members vote, and they vote for 5 people, that's still 25 million records.

Ok... some of you might not consider it that big, i do. Biggest DB i worked with had about 60k records only  ;)

 

But, is that the way it works, or there might be other methods?

 

Curiosity...

Link to comment
https://forums.phpfreaks.com/topic/72643-how-does-hi5-style-of-voting-works/
Share on other sites

Well you have to record each vote or else you can really check if the same one has happened. I use something like this for one of my sites:

 

Votes:

--------

id

userid

voterid

vote

 

I guess if you are talking about millions of votes you could make multiple tables to handle different userid's: votes1 (handles users 1-1,000,000), votes2 (handles users 1,000,001-2,000,000), etc... So when you vote for someone your script does a simple IF then finds what table it needs to look for...then does the rest.

I guess if you are talking about millions of votes you could make multiple tables to handle different userid's: votes1 (handles users 1-1,000,000), votes2 (handles users 1,000,001-2,000,000), etc... So when you vote for someone your script does a simple IF then finds what table it needs to look for...then does the rest.

 

I'd advise against this, if your database is designed well with indexes in the right place then there shouldn't be any need to go this route.

 

Regards

Huggie

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.