Question 2: Persistent Data [10]

Preamble:
Suppose you are part of a team that is writing a program that issues instructions to several devices in based on short data messages fed to the program from a sensor. The incoming messages vary in length from 12-24 characters, with the total number of messages coming in at a rate of 1-3 per second (thus typically 1-6 megabytes of data comes in each day). The outgoing instructions are each four characters long.

The hardware exists in a hostile climate, so it sometimes experiences system failures. An external monitoring system is already in place that can check the the hardware and attempt to restart both it and your program in the event of a failure, but on restart it is important for your program to determine what state it was in just prior to the failure.

The system resources do not allow for the use of a database or network connection (periodically a technician comes to check the system and transfer any recorded data).

Your role on the team is (i) to design and implement the routine(s) to log the time and content of the sensor messages received and the instructions dispatched to the devices, and (ii) to design and implement the routine(s) used during a restart to identify the what messages had been processed and what instructions had been dispatched - thus enabling the program to identify its last known state prior to the failure.

Your task for this exam question is to provide preliminary design ideas for problems (i) and (ii), and to note any problems/difficulties you see with your suggestion.