UltraLite Database User's Guide
Synchronization for UltraLite Applications
Introduction
Many mobile and embedded computing applications are integrated into an information infrastructure. They require data to be uploaded to and downloaded from a consolidated database. This bi-directional sharing of information is synchronization.
MobiLink synchronization technology, included in SQL Anywhere Studio along with UltraLite, is designed to work with industry standard SQL database-management systems from Sybase and other vendors. UltraLite automatically keeps track of changes made to the UltraLite database between each synchronization with the consolidated database. When the UltraLite database is synchronized, all changes since the previous synchronization are uploaded.
Mobile and embedded databases generally cannot contain all the data that exists in the consolidated database. In practice, however, the only data you need locally is that used by the particular application you wish to make mobile. UltraLite provides the ability to take such a piece of a database, and keep it synchronized with the consolidated database.
The tables in each UltraLite database can have a subset of the rows and columns in the central database. For example, a customer table might contain over 100 columns and 100 000 rows in the consolidated database, but the UltraLite database may only require 4 columns and 1000 rows. MobiLink allows you to define the exact subset to be downloaded to each remote database.
MobiLink synchronization is flexible. You define the subset of data using the native SQL dialect of the consolidated database-management system, Java, or a .NET programming language. Tables in the UltraLite database can correspond to tables in the consolidated database, but you can also populate an UltraLite table from a consolidated table with a different name, or from a join of one or more tables.
Mobile and embedded databases frequently share common data. They also must allow updates to the same data. When two or more remote databases simultaneously update the same row, the conflict cannot be prevented. It must be detected and resolved when the changes are uploaded to the central database. MobiLink synchronization automatically detects these conflicts. The conflict resolution logic is defined in the native SQL dialect of the consolidated database, in Java, or in a .NET programming language.
An UltraLite application synchronizes with a central, consolidated database through the MobiLink synchronization server. This server provides an interface between the UltraLite application and the database server.
You control the synchronization process using synchronization scripts. These scripts may be SQL statements or procedures written in the native language of the consolidated DBMS, or they may be Java classes. For example, you can use a SELECT statement to identify the columns and tables in the consolidated database that correspond to each column of a row to be downloaded to a table in your UltraLite application. Each script controls a particular event during the synchronization process.
UltraLite databases can synchronize with a MobiLink synchronization server over one of a set of synchronization streams, including TCP/IP, HTTP, and HTTPS. ActiveSync synchronization is available for Windows CE applications under some development models. HotSync is available for Palm OS applications.
Each synchronization stream has a set of appropriate stream parameters. These parameters set required values for the stream, such as the location of the MobiLink synchronization server, and network-specific control parameters.