We recently built the tallying software used to aggregate votes in the Libyan constitutional assembly elections. Our software recorded, verified, and reported on over 720,000 votes cast by Libyan citizens. These votes were cast throughout the country, on off-shore oil rigs, and at international voting centers throughout the world.
The Libyan High National Election Commission has generously made the tally system software open source. All application source code is on github, there is an overview of the tallying process, and additional code documentation.
The system overview provides a detailed description of each phase in the tally process and the additional stages used for review of suspicious or otherwise problematic forms.
The tally system has a suite of administrator functionality for viewing form state, approving administator only actions, and viewing the results.
We use PostgreSQL as the datastore. We chose PostgreSQL because it is a CP and ACID database, which has been shown to not lose data. We include scripts to setup database replication and create automated backups of the database.
In a production environment we recommend replicating the database to at least one additional machine and dumping the database from that machine. This ensures you have a live duplicate in the case of a failure and that the process of backingup data does not interfere with live system operations. (In the case that the master node fails and the replicated node becomes the master you should disable backups until the master node has recovered.)