Pervasive logo

Prev Advanced Operations Guide Next

Pervasive.SQL Database Engine


The Pervasive.SQL engine consists of two database sub-engines:

Common Address Space

Pervasive.SQL uses an optimized memory architecture that provides high performance for both transactional and relational data access methods. On Windows platforms, both the MKDE and the SRDE load and operate in the same process address space, minimizing the CPU time required to communicate between them.

Row Level Locking

Row level locking improves database engine performance in multi-user environments in which many updates and writes occur at the same time, or in which transactions remain open for an extended period of time.

In releases prior to Pervasive.SQL 2000i SP3, the database engine locked data pages containing more than one record in order to update any record on that page. Any other client attempting to update records on that page while the page was still locked had to wait until the first operation released the page lock. This behavior occurred even though the records needed by the second operation were not affected by the first operation.

With the current row level locking architecture, a transaction locks only the rows that it affects directly, not the entire page. One client can update records on a given page at the same time as another client updates different records on the same page. Waiting is necessary only when a second application attempts to modify the exact same records currently locked by the first application. Thus, row level locking decreases overall wait time and improves performance in a multi-user environment.

This feature is completely transparent within the MicroKernel Database Engine. There are no changes to the Btrieve API, data file format, configuration settings, or any external component. This feature is always on and is supported across Server and Workgroup products as well as all supported operating system platforms. This feature is supported for data file format v6.x and later. It is not supported for data file format v5.x or earlier.

In this release, row level locking is implemented for key pages and data pages only, not variable pages. Furthermore, a small percentage of key page changes may cause key entries to move from one page to another. An example is when a key page is split or combined. These changes retain a full page lock until the transaction is completed.

MicroKernel Database Engine

The MicroKernel Database Engine (MKDE) provides Btrieve/MicroKernel API support for Pervasive.SQL applications. Both versions of the engine-Server and Workgroup-support local applications running on the same computer as the engine. The server MKDE supports both local applications and remote (client/server) applications. The workgroup MKDE supports applications running on remote machines as well and can service requests made by another peer workgroup engine on a remote machine.

There are two versions of the MicroKernel engine in this release. The server engine runs on Linux, Windows servers, and NetWare. (The NetWare version runs as an NLM directly on a NetWare server.) The Workgroup engine runs on Windows only and is designed for single-user or small workgroup configurations.

For servers, Btrieve client platforms include DOS and Windows 98/NT/2000/XP. Win16 Btrieve applications running on a Win32 workstation that is executing a Pervasive.SQL engine locally are supported using the existing Btrieve thunk mechanism. Thunking is also the default configuration for remote Pervasive.SQL engine access from a Win16 Btrieve application running on a Win32 workstation. It is possible to build Btrieve applications as NLMs (NetWare Loadable Modules) that access a local MKDE on NetWare. DOS applications running on a Windows 98/ME machine use BTRBox95.

The Workgroup engine is by default configured to start up when you log into Windows. A Workgroup engine can service requests made by another peer engine if the files have already been opened by the engine. It can also serve in a gateway mode by configuring a particular machine and database engine to act as a gateway, thus preventing another Workgroup engine from opening the files.

A "tray icon" is displayed to provide a graphical indication when a Pervasive.SQL Workgroup MKDE is running. No tray icon is displayed when the Workgroup MKDE is not running. The tray icon does not display for the server engine.

The Btrieve and ODBC APIs in Pervasive.SQL support writing distributed database applications that hide the details of connecting to a local or remote database engine from an application. Using this architecture, an application can access data that is co-located with the application (that is, running on the same computer as the application) while also accessing data on a remote computer. Moreover, a SQL database can be distributed by having DDFs (data dictionary files) serviced by a local MicroKernel Database Engine and data files (tables) serviced by a remote MicroKernel Database Engine. Such a SQL database, which is not serviced exclusively by a local MicroKernel Database Engine, is referred to as a "mixed access database."

Mixed-access databases are subject to the following constraints:

Asychronous I/O

The Server MicroKernel engine for Win32 uses asychronous I/O when writing pages to disk. This feature improves performance. The MicroKernel quickly writes pages to the Windows system cache or its own cache. In turn, Windows signals when the pages are on disk, helping the MicroKernel to perform write operations efficiently.

Read performance is also enhanced when there are many concurrent operations being done in the MicroKernel at the same time, especially if you access your data set on a striped set of disk drives. Each read causes a worker thread to wait until the page is available. With asynchronous I/O, the operating system can pool the work of multiple readers to make the read operations more efficient.

SQL Relational Database Engine

The Pervasive.SQL Relational Database Engine (SRDE) provides ODBC support for Pervasive.SQL applications. The SRDE runs as a service on Windows NT, as an NLM on NetWare, and as a daemon on Linux.

ODBC client platforms include Windows 98/NT/2000/XP. Remote ODBC application access to the SRDE requires installation of the ODBC Client, which is a specialized ODBC driver that routes client-side ODBC calls to the ODBC communications server over the network.

Win16 ODBC applications running on a Win32 workstation that is executing a Pervasive.SQL engine locally are supported using the ODBC thunk mechanism. Thunking with the Microsoft-provided ODBC thunk DLLs is required for remote Pervasive.SQL engine access from a Win16 ODBC application running on a Win32 workstation.

Features of the SRDE include:

The ODBC communications server performs the following functions:


Prev
Understanding the Pervasive Component Architecture
Contents
Up
Check for Revisions
Next
Relational Architectural Overview