Sybase Technical Library - Product Manuals Home
[Search Forms] [Previous Section with Hits] [Next Section with Hits] [Clear Search] Expand Search

 About This Book [Table of Contents] Chapter 2:  A Sample UltraLite Application

Ultralite Developer's Guide

[-] Chapter 1: About UltraLite

Chapter 1

About UltraLite

About this chapter

This chapter introduces you to UltraLite. It describes the purpose and defining characteristics of UltraLite.

What is UltraLite?

UltraLite is a deployment technology for Adaptive Server Anywhere aimed at mobile devices and embedded devices. Intended platforms include cell phones, pagers, and personal organizers. The purpose of UltraLite is to provide the functionality and reliability of a SQL database running on these devices and the ability to synchronize data with your central database management system, while maintaining an extremely small footprint.

Full-featured SQL

UltraLite allows applications on these devices to use full-featured SQL to accomplish data storage, retrieval, and manipulation. UltraLite supports referential integrity, transaction processing, and multi-table joins of all varieties. In fact, UltraLite supports most of the same data types, runtime functions, and SQL data manipulation features as Sybase Adaptive Server Anywhere.

Small footprint custom database

UltraLite provides an ultra-small footprint by generating a custom database engine for your application. This custom engine includes only the features required by your application. Each UltraLite application contains its own database. This database is modeled after a reference Adaptive Server Anywhere database. An UltraLite application is written in C/C++ with embedded SQL.

The UltraLite development tools pre-process the embedded SQL, analyze the reference database, and generate C/C++ source code that implements the SQL operations in your application. When this generated code is compiled and linked with the UltraLite runtime, the result is a custom database engine for your application that can be as small as 50 kb. The code footprint for an UltraLite database engine depends on the number of SQL statements in the application and the SQL features used.

In-memory database

UltraLite target devices have no hard disk and tend to have relatively slow processors. The UltraLite runtime is optimized for in-memory databases, employing algorithms and data structures that provide high performance and low memory use.

Synchronization to industry-standard RDBMS

UltraLite includes MobiLink synchronization technology, which allows UltraLite databases running on mobile or embedded devices to synchronize with industry-standard database management systems. MobiLink synchronization works with any ODBC-compliant data source. For example, UltraLite databases can synchronize with Sybase Adaptive Server Anywhere, Sybase Adaptive Server Enterprise, Oracle, and Microsoft SQL Server.

Platforms

This version of UltraLite allows development of applications in the following environments:

The UltraLite tools also allow you to develop applications that run on Windows NT, so you can test the database logic in your application without downloading the UltraLite application to the target device.

Architecture

SQL database products typically use a client/server architecture. The database is normally stored in one or more files in the file system or directly on a storage device. The database server receives and processes SQL requests from client applications, maintaining the database according to the requests. The server protects you from failures by guaranteeing that complete transactions are recovered in case of a failure and incomplete transactions are rolled back.

One executable

UltraLite has the same client/server architecture as other SQL database systems. However, the UltraLite database engine is not a separate process. The database engine is linked together with the application to form a single executable. The UltraLite runtime support is accessed from a DLL or from a statically linked library.

The UltraLite development process generates C/C++ source code that is compiled along with your application source code. When you link your application, you link all of the compiled C/C++ together with the UltraLite runtime library or imports library. The result is a single executable file containing application logic and database logic required by the application.

raster

When first executed on a new device, this executable automatically creates the UltraLite database. This database is initially empty, but you can add data, either explicitly or through synchronization with a central database.

Persistent memory

UltraLite provides the same protection against failures as other SQL database systems. UltraLite maintains the database in persistent memory rather than in a file. UltraLite target devices have no disk drive, but instead feature memory that retains content when the device is not running.

Fixed schema

UltraLite does not allow the schema of an UltraLite database to be modified once the application is deployed. When a newer version of the application requires more tables or more columns, the newer version of the application is deployed and the UltraLite database is repopulated through synchronization.

Parameterized SQL statements

The SQL statements used in the application must be determined at compile time. In other words, you cannot construct a SQL statement within an UltraLite application and execute it. SQL statements in an UltraLite application incorporate host variables (C/C++ variables), so they can have different effects and results depending on the input variables.

Creating an UltraLite application

To create your own UltraLite application, you write or create the following items.

raster

Building your application

You then use UltraLite development tools, together with your compiler and linker, to build the application for your intended platform.

The following diagram depicts the procedure of building an UltraLite database application.

raster

Deploying your application

To deploy your application, simply copy the single executable file to a device of your choice.

raster

For detailed instructions, see Developing UltraLite Applications .

MobiLink synchronization

Most mobile and embedded applications require data to be uploaded to a central database, downloaded from a central database, or both uploaded and downloaded. This functionality is essential to making the application function effectively within the information infrastructure of an organization. MobiLink synchronization technology, included with UltraLite, is designed to work with industry standard SQL database management systems from Sybase and other vendors.

The UltraLite runtime automatically keeps track of changes made to the UltraLite database between each synchronization with the central database. When the UltraLite database is synchronized, all changes since the previous synchronization will be uploaded.

Subset of the central database

Mobile and embedded databases contain a small fraction of the data that exists in the central database. The central database is called the consolidated database: it consolidates all the data throughout the MobiLink installation.

The tables in each UltraLite database can have a subset of the rows in the central database and a subset of the 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 central database management system. In most cases, tables in the UltraLite database will correspond to tables in the central database, but this is not required. You can populate an UltraLite table from a consolidated table with a different name, or from a join of one or more tables.

When synchronizing, it is important to only transfer data that has changed rather than a complete copy of the data. The uploaded data is automatically determined by the UltraLite runtime. The downloaded data is defined using the native SQL dialect of the central database management system. This system ensures that only data that needs to be transferred is transferred.

Conflict Resolution

Mobile and embedded databases frequently share common data. They also must allow updates to the same data. When two or more remote databases update the same row, the conflict cannot be prevented. It must be detected and resolved when the changes are uploaded to the central database. UltraLite synchronization automatically detects these conflicts. The conflict resolution logic is defined in the native SQL dialect of the central DBMS.

The MobiLink server

An UltraLite application synchronizes with a central, consolidated database through the MobiLink server. This server provides an interface between the communications from the UltraLite application and the database server.

raster

You control the synchronization process using scripts. These scripts are SQL statements or procedures written in the native language of the consolidated DBMS. 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 uploaded from a table in your UltraLite application. These scripts are stored in tables within the consolidated database. Each script controls a particular event during the synchronization process.

Synchronization channels

Synchronization can occur through a variety of channels. One option is a TCP/IP connection between the application and the MobiLink server. Other platforms require different solutions. For example, the Palm Computing Platform can use HotSync, TCP/IP, or direct serial port communication. Regardless of the channel, you control the synchronization process using the same SQL scripts defined in your consolidated database.

For a detailed introduction to MobiLink synchronization, see MobiLink Synchronization .

Enterprise productivity

UltraLite was designed for development using familiar tools, skills, and components already present in your enterprise. You can thus leverage the current capabilities of your organization.

High-level programming and portability

UltraLite encourages high productivity by providing robust, high-level programming solutions on an increasing variety of devices. An application can be developed and implemented using the proven and powerful methodology of full-featured SQL. You need not become familiar with device-specific aspects (such as flash memory) and the disparate operating system interfaces that provide access to them. Similarly, synchronization can be achieved without becoming an expert in the various transmission protocols. Moreover, the database and synchronization components in your application are portable.

High-level development environments

UltraLite allows you to continue to use whatever tools you already use for productive development. It adds functionality to your development process. For example, you can develop applications using Microsoft Visual C++ and test them in the various Windows PC environments before deploying them, for final testing, on a specific device.

Industrial Strength

UltraLite cooperates with all the popular industry databases, not just those from Sybase. Built with the established technology of Sybase Adaptive Server Anywhere, it uses mature and proven database technology.

What's new in 6.0.3

Following is a list of changes and additions to the software since version 6.0.2.

Behavior changes

Upgrade issues

You do not need to upgrade your existing reference or consolidated databases in order to use this version of the software.

Older versions of UltraLite applications can synchronize with the new version of the MobiLink synchronization server. However, new UltraLite applications cannot synchronize with older versions of the MobiLink synchronization server.


 About This Book [Table of Contents] Chapter 2:  A Sample UltraLite Application