Gath Posted October 10, 2007 Share Posted October 10, 2007 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 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... Quote Link to comment https://forums.phpfreaks.com/topic/72643-how-does-hi5-style-of-voting-works/ Share on other sites More sharing options...
cmgmyr Posted October 10, 2007 Share Posted October 10, 2007 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. Quote Link to comment https://forums.phpfreaks.com/topic/72643-how-does-hi5-style-of-voting-works/#findComment-366536 Share on other sites More sharing options...
HuggieBear Posted October 15, 2007 Share Posted October 15, 2007 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 Quote Link to comment https://forums.phpfreaks.com/topic/72643-how-does-hi5-style-of-voting-works/#findComment-369799 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.