1 Mobile Client Overview

Oracle Database Mobile Server delivers critical bi-directional data synchronization capability to mobile or fixed location distribution devices, while providing a centralized backend interface for managing mobile deployments. On the client device, the mobile client facilitates the transfer of data to and from the client database, which can be either Berkeley DB or SQLite. Install the desired database and the mobile client for Berkeley DB or SQLite on your client device.

The following sections describe both databases and the mobile client for these databases:

1.1 Mobile Client Architecture

As shown in Figure 1-1, when both the client database and the mobile client are installed, the mobile device has the following components:

  • Client database—The client database can be either Berkeley DB or SQLite, which is installed independently of the mobile client.

  • Mobile client—When you install the mobile client, the following components are provided:

    • Sync Engine—Automatic synchronization can be enabled on the Android, Win32, WinCE, and Linux platforms. However, you can initiate manual synchronization within a mobile application on all platforms.

      The Sync Engine interacts with SQLite database to upload and download data in conjunction with the mobile server to synchronize the data with the Oracle database.

    • Device Manager Agent (DM Agent)—The mobile server uses the DM Agent to send commands to the mobile device for remote management. The DM Agent is only installed on Android, Win32, WinCE, and Linux platforms. The Blackberry, OJEC mobile client and pure Java client installed on standard Java SE platforms cannot be remotely managed

  • Mobile application—Interacts with the client database to manage the data and with the Sync Engine to initiate a manual synchronization.

Figure 1-1 Architecture for Device with a Mobile Client and Client Database

SQLite Mobile client architecture
Description of "Figure 1-1 Architecture for Device with a Mobile Client and Client Database"

The following sections describe each mobile client:

1.2 Mobile Client for the Berkeley DB SQL Interface

Berkeley DB is a general-purpose, high-performance, embedded database that is designed for high-throughput applications. The primary goal of Berkeley DB is to deliver fast, scalable and flexible data management services to your application while remaining transparent to the end-user. Berkeley DB executes in the same process as your application.

Berkeley DB provides the following features that are expected of client/server enterprise-scale SQL databases: high throughput, high availability, high concurrency, replication, low-latency reads, non-blocking writes, failure recovery, data scalability, in-memory caching, ACID transactions, automatic and catastrophic recovery. Berkeley DB offers advanced features in a self-contained, small footprint software library.

The mobile client was built to use the Berkeley DB SQL interface, which adds a SQL API to the Berkeley DB storage engine. The mobile client uses this interface to facilitate synchronization between the client and the back-end database.

The following sections describe the Berkeley DB SQL interface and how it is used to synchronize data with the mobile client:

1.2.1 Introducing the Berkeley DB SQL Interface

The Berkeley DB SQL interface comes with a SQL processor layer on top of Berkeley DB. The Berkeley DB SQL interface is compatible with SQLite, so it can be used as a replacement for SQLite applications. Thus, you can manage relational data in Berkeley DB, but access the data with the SQLite3 API.

The interaction with the Berkeley DB SQL interface is almost identical to SQLite. You can use the same APIs, SQL statements, command shell environment, and most of the PRAGMAs with the Berkeley DB SQL interface. There are no differences in the SQL data types between the Berkeley DB SQL API and the SQLite API. The Database Mobile Server install package comes with prebuilt libraries for BDB.

The documentation for the Berkeley DB SQL interface is in two books within the Berkeley DB documentation:

  • Berkeley DB Installation and Build Guide—The SQL interface is not installed by default. You must explicitly request it to be included when building Berkeley DB. The "Building the SQL API" section in this book details the correct build steps for the Berkeley DB SQL interface. It also includes information on compatibility with SQLite.

    This section can be accessed at the following site:

    http://download.oracle.com/docs/cd/E17076_02/html/installation/build_win_sql.html
    
  • Getting Started with the Oracle Berkeley DB SQL APIs—The main book for the Berkeley DB SQL interface, which can be accessed at the following site:

    http://download.oracle.com/docs/cd/E17076_02/html/bdb-sql/index.html
    

The Berkeley DB product and all documentation is available at the following site:

http://www.oracle.com/technetwork/database/berkeleydb/overview/index.html

The default installed BDB SQL interface DLLs and the command line interpreter are named as follows:

  • dbsql.exe on WIndows and dbsql on UNIX—This is the command line shell. It operates identically to the SQLite shell, sqlite3.exe on Windows and sqlite3 on UNIX.

  • libdb_sql52.dll on Windows and libdb_sql-5.2.so on UNIX—This is the library that provides the BDB SQL interface. It is the equivalent and compatible with the SQLite library, sqlite3.dll on Windows and libsqlite3 on UNIX.

If you want the names to be exactly the same names as SQLite, you can perform the following:

  • On Windows, copy dbsql.exe to sqlite3.exe and libdb_sql52.dll to sqlite3.dll. Once copied, you can use these applications as a replacement for the standard SQLite binaries with the same names.

  • On UNIX, specify the compatibility option (--enable-sql_compat) for the BDB SQL interface UNIX build.

However, this must only be performed with extreme caution. For more details on building the BDB SQL Interface to have the same names as SQLite, see "Building the SQL API" section in the "Berkeley DB Installation and Build Guide" in the Berkeley DB documentation.

1.2.2 Synchronizing Data from Berkeley DB to a Back-End Oracle Database

The mobile client synchronizes the data in Berkeley DB with the mobile server. This book describes how to configure, manage and implement synchronization using the mobile client. It does not discuss how to build, install, configure, manage or use the Berkeley DB SQL interface.

1.3 Mobile Client for SQLite

SQLite is a small, compact, and self-contained database available on multiple platforms and available to the public. It has a small footprint and is easy to install and administer. In addition, many devices have SQLite already installed, including Android and Blackberry devices.

You can synchronize the data in one or more SQLite databases to a back-end Oracle database with the mobile client. This mobile client provides the ability to synchronize the data in SQLite databases with the Sync Engine contained within the mobile client.

SQLite is installed independently from the mobile client. SQLite does not provide the same SQL functionality as an Oracle database. This book describes how to configure, manage and implement synchronization using the mobile client. It does not discuss how to configure, manage or use SQLite. For information on SQLite and a full list of what functionality is supported, see http://www.sqlite.org/.

The SQLite Mobile Client can be installed on the following platforms: Linux, Windows (Win32), WinCE, Android, and Blackberry platforms. Device management is supported on Android, Win32, WinCE and Linux platforms. The Sync Engine supports both automatic and manual synchronization for SQLite. However, without device management support, remote device management and automatic synchronization is not supported on the Blackberry platform.