Friday, August 20, 2010

TeamHaven Mobile synchronisation explained

TeamHaven Mobile is designed to minimise the volume of data that is transferred during synchronisation in order to reduce battery drain and cell phone bills.

When a user hits the green "Synchronise" button, TeamHaven Mobile typically executes two steps:

Step 1: Completed calls are uploaded to the server.
Step 2: The local database cache is synchronised with the server.

Call Uploading
Calls shown in TeamHaven Mobile's "Completed and Ready To Send" category are sent to the server, and once the server has confirmed that the data has been successfully received, the PDA moves them to the "Completed" category, where they will remain until the local database is synchronised with the server, at which point they may be deleted (this depends on the settings of the project that the calls belong to).

Full Synchronisation
This only occurs when the user forces it using the "Rebuild Database" option or when a different user has logged into TeamHaven Mobile. The local database cache on the PDA is deleted, an empty one is created and then a normal "Partial" synchronisation is triggered. Because there is no data in the local database cache, this means that all necessary data will be downloaded from the server.

Partial Synchronisation
This is TeamHaven Mobile's default strategy. It sends a summary of what its local database currently contains to the server, when then sends back new and updated records along with a list of which records are no longer needed. TeamHaven Mobile then processes this data by inserting, updating and deleting information in the local database cache accordingly.

Options and conditions that affect this sequence
1. If the "Upload only on battery" option is ticked and the PDA is not connected to a power source, then only step 1 (Upload completed calls) is carried out. Database synchronisation will only occur when the PDA is plugged into a power source.

2. If the "Only synchronise every N hours" option is filled out, then only step 1 will be carried out unless it has been more than N hours since the last database synchronisation. If it has been more than N hours, then step 2 is also carried out.

3. If completed calls were not successfully uploaded to the server in step 1, then step 2 is not carried out.