Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Implementing a live voting system

I'm looking at implementing a live voting system on my website. The website provides a live stream, and I'd like to be able to prompt viewers to select an answer during a vote initiated by the caster. I can understand how to store the data in a mySQL database, and how to process the answers. However:

How would I initially start the vote on the client-side and display it? Should a script be running every few seconds on the page, checking another page to see if a question is available for the user?

Are there any existing examples of a real-time polling system such as what I'm looking at implementing?

like image 272
Will Eddins Avatar asked Jan 07 '11 02:01

Will Eddins


People also ask

Which database is best for live voting system?

mysql - Database design for voting module with long-run and high-load capability - Database Administrators Stack Exchange.

What are 3 methods of voting?

The regular methods of voting in such bodies are a voice vote, a rising vote, and a show of hands. Additional forms of voting include a recorded vote and balloting. The assembly could decide on the voting method by adopting a motion on it. Different legislatures may have their voting methods.

What is automated voting system?

1. Automated election system — a system using appropriate technology for voting and electronic devices to count votes and canvass/consolidate results; 2. Counting machine — a machine that uses an optical scanning/mark—sense reading device or any similar advanced technology to count ballots; 3.

What are the advantages of online voting?

Benefits. Electronic voting technology intends to speed the counting of ballots, reduce the cost of paying staff to count votes manually and can provide improved accessibility for disabled voters. Also in the long term, expenses are expected to decrease. Results can be reported and published faster.


1 Answers

You would have to query the server for a new question every few seconds.

The alternative is to hold the connection open until the server sends more data or it times out, which just reduces (but does not eliminate) the server hits. I think it is called "long polling". http://en.wikipedia.org/wiki/Push_technology

like image 144
chustar Avatar answered Sep 19 '22 03:09

chustar