Voting systems are pretty simplistic in their nature, whatever twist you put on them - whether it's an up and down vote like Digg.com utilizes, or a polling system where users are selecting one or multiple of several choices. Why then do most websites have an accuracy waiver type notice? And why then is Diebold one of only a few companies that put together electronic voting machines?
The answer is that maintaining a data structure that incorporates verifiable accuracy and high speed access within a system that supports reasonable security measures is much more complicated than it is on the surface. Don't get me wrong. I don't think Diebold machines are accurate, high speed, or reasonably secure either.
When putting toegether an online voting mechanism, you want to be able to present results as quickly as people are voting. In a high traffic environment, that presents a bit of a problem. All of the following things have to happen:
- Connect to a database
- verify vote legitimacy
- insert new vote record
- query for counts of existing votes
- database disconnect
- output data
Not a huge set of requirements, but in a high traffic environment with hundreds of polls, it can be a bit of a bear trying to wrap it all up quickly enough. There are a couple of different strategies that you could employ - a simple counter table with one record per selection per poll is the easiest and most high speed - but then what do you do about multiple votes per IP address or user record? You could set cookies, but that is easy to get around - even for web novices.
For a site like Digg that tracks up and down votes on hundreds of stories a day, it doesn't seem practical to maintain separate databases for each article - nor does it seem practical to maintain a voting history table for each user.
I'm thinking that a more complex structure would be necessary to maintain all of the information you would want, and you would probably be best off utilizing the Berkeley engine rather than pushing things off to an RDBMS. More on this subject later.
Discuss Voting Systems
