Solving portuguese elections problems with 10 EUROS…
Today is presidential elections day in Portugal. Every voter should know his/her voter ID and the location where he/she votes. The problem is that many people don’t remember their voterID and only remember to check it in the election day. Also, thousands of voters now own the new revolutionary portuguese Citizen Electronic Card and they aren’t aware of the changes taht this process made in their location voting address.
To help people find their voterID, some years ago, the MAI (Internal affairs) implemented a service for voters check their ID by submitting their CitizenID and birthdate using a website or sending an SMS to a service. This would be perfect, if it worked flawlessly in the election day…
But, it didn’t work as expected. Today the .NET based site was almost impossible to access and when users could open the site they were hitting lots of IIS Service Availability errors.
Portugal has 9.5 million estimated voters and I don’t believe that more than 5% of people tried this service. So in the worst case, 475000 people used this service. So lets imagine that 75% of voters used this service in the frametime between 11:00 and 15:00, the time most people vote. This would give around 360000 people checking up their voterID in 4 hours. As you probably know an hour is 3600 seconds, so at the highest peak 25 voters would check their VoterID every second. The question I do is: Is this too much? Is this a difficult issue to solve?
My answer… “WTF are these guys doing?” With a daily 10 EUROS infrastructure I would handle this problem and would serve all european voters at the same time! 🙂 How? Its simple… Check it out…
What we need to solve this problem?
1.2- Network connection
1.1- A database with all voters IDs
1.2- An Http or APP server
1.3- A simple application
Now you ask, “how can you solve it with only 10 euros daily?” … My answer: “Dude, look to the sky… You can get over all that heat with the CLOUD!”. I would use cloud computing.
Let me explain… I would use 2 Amazon EC2 instances, one with a running VoltDB database and the other one with a python/php/java application running on an HTTP enabled web server.
As you know (or not), VoltDB is an in memory database, all the data rely on memory. So, how much memory would I need to store all this Voters info? Lets assume I would store 100 chars for the voter name, 10 chars for CitizenID, 50 for the location to vote, 30 chars for some other info, and finally 10 chars for the VoterID. Look, this would give 200 bytes! All portuguese voters basic info to solve this problem can be stored in 1.900.000.000 bytes, this is JUST 1.8 Gigabytes of memory! I would store all that info easily with an EC2 Large instance for the DB server and would run the application in a High CPU instance APP server. The instances I would choose would be:
7.5 GB memory with 4 EC2 Compute Units
High-CPU Medium Instance
1.7 GB of memory with 5 EC2 Compute Units
This hardware infrastructure would cost around 10 euros daily (yes, you can check AWS pricing to see that I’m right) and would solve the problems that didn’t allow lots of voters to do their civil rights!
If you read my previous post about VoltDB you remember that I easily processed around 13 thousands requests per second in my 5 years old IMAC. So with an EC2 instance like the one I describe earlier do you doubt that I would easily process 25 query requests per second? 🙂 The DB is not a problem… Neither the APP server isn’t it? 25 requests per second? Are you kidding? 🙂
Now you may say, well speaking “blah blah blah” is easy… Doing it, it’s a lot harder! And I say to you… I’ll do it and I will show it in a future post. I will load a 10 million records database with VoltDB, creating a simple python (or any other language) query application and use another instance to simulate the queries against this infrastructure… So keep tuned in and have a nice week…