General information of Sybase SQL Anywhere
Sybase SQL Anywhere is a relational database system proposed by Sybase iAnywhere for mobile devices such as laptops and mobile phones. It supports normal operating systems such as Unix, Mac OS, Windows Vista/XP, and Linux with a footprint at around 8M (6M for the database and 2M for synchronization). For mobile phones, SQL Anywhere has a light version called UltraLite that supports Palm OS, BlackBerry, Embedded Linux, Windows Mobile 6, and Java ME devices with a small footprint that is less than 1M. Both SQL Anywhere and UltraLite fully support flat ACID transactions.
MobiLink server manages the synchronization
The synchronization between the mobile database and the backend database is managed by MobiLink server. A MobiLink server has a consolidate database that holds system objects that are required for the synchronization. In most cases it also holds application data. The consolidate database is a staging of the backend database. Updates to the backend database will eventually be reflected in the consolidate database and vice versa. The synchronization is actually performed between the mobile database and the consolidate database. If the consolidate database supports Snapshot Isolation, the default consistency degree is SI. Otherwise, the default consistency degree is read-committed.
Synchronization process and validation
Rules used to download data from the server to a mobile client and to upload updates from a mobile client to the server are defined using scripts. Synchronization is triggered on a mobile client. Updates performed after the last synchronization are uploaded to the MobiLink Server. Each updated data item has two values: a new value after the update and an old value before the update. When updates arrive at the MobiLink server, they are validated for final commit. If the old value of a data item is equal to the current value of the data item in the consolidate database, the new value of the data item can commit. Otherwise, a conflict is detected. Developers also can define other rules to check conflicts. When a conflict is detected, a conflict resolution script defined by developers is executed to resolve the conflict. If the conflict cannot be resolved or resolution scripts are not defined, the corresponding update transaction will be aborted. After the upload processing, the MobiLink server downloads updates performed on the consolidated database after the last synchronization of the MC to the MC. After the MC receives all downloading contents, the synchronization completes.
This approach shows a typical industry solution for mobile transactions. Updates of mobile transactions are batched until the next synchronization and hence the communication cost is saved. The abortion rate of mobile transactions is constrained by letting developers define conflict resolution methods to fix conflicts when it is possible.