Handling loss of data access due to server downtime

On 28th and 29th of September 2007, P.C. College of Engineering had organized a technical event called ‘Blitzkrieg 2007‘. I was involved in creating the script to allow users to register themselves as participants for various competitions. This simple script had two responsibilities.

The script was pretty simple and worked fine till the day of event. Organizers were able to view all participants who had registered for competitions. However, during the day of event (28th September 2007), organizers faced a problem that we had not at all considered. The hosting plan for Blitzkrieg website had provided them with small bandwidth. Due to this, the allocated bandwidth got over on the day of event and organizers were unable to view the site and get participant’s list.I had never experienced such a problem before. Was it possible for me to write a script in such a way to handle this situation? It was definitely not possible to increase the bandwidth using a PHP script, but yes, there was a trick that would have helped organizers to access the latest data.Before understanding this hacky solution, let’s understand what the actual script used to do:

  1. Display a registration form to the user
  2. Get the data provided by user and validate it
  3. If the data was valid, then store the data and send a mail to registered user (participant), informing him about successful registration.

Here, we would have added an extra step to send a mail to organizers after every successful registration with corresponding sql (insert or update sql). This would have given organizers a list of sql commands which if they could have executed on local database. This would have provided them with local access to list of participants even in case of bandwidth failure on central server.

This solution is just a precautionary measure to handle such kind of situations. It has to be implemented before the problem occurs. In our case, we had to call the customer support of our web-host who acted quickly and increased the bandwidth, allowing organizers to view the list of participants.