Adding synchronization functionality to an application adds a degree of complexity to your application. While the added complexity is almost always manageable, you need to be aware of it.
The entire synchronization system, from the remotes through to the consolidated database, including other consolidated database applications, has many parts and each requires attention. The following tips may be useful.
When you are adding synchronization to a prototype application, it can be difficult to see which components are causing problems, so start with a prototype without synchronization. Once your prototype is working correctly, only then do you enable synchronization.
Start with straightforward synchronization techniques. Operations such as a simple upload or download require only one or two scripts. Once those are working correctly, you can introduce more advanced techniques, such as timestamps, primary key pools, conflict resolution, and arbitrary business logic.
In a synchronization system, the primary key is the only way to identify the same row in different databases (remote and consolidated) and the only way to detect conflicts. Therefore, MobiLink applications must adhere to the following rules:
Every table that is to be synchronized must have a primary key.
Never update the values of primary keys in synchronized tables.
Primary keys in synchronized tables must be unique across all synchronized databases.