Transaction Management (TFS)

The transaction management portion of the system handles the client connections (local or remote) and arbitrates the access to the individual databases instances.

There is a clear delineation between the runtime library and the TFS. The runtime library understands and manipulates databases, using catalogs that describe the database structure and keeping a local cache of database objects that have been read, created or modified at the request of the application. All of the row and column interpretation is done within the runtime library. The runtime library needs to have a handle to one or more TFSs to do any work.

The TFS is responsible for safely storing the retrieving objects, regardless of the contents of those objects. To the TFS, the objects are opaque sequences of bytes with a given length. When asked to store objects, it does so in a way that is transactionally safe and recoverable. When asked to retrieve objects, it returns the same opaque sequence of bytes. It is like a key/value store, but very fast and transactionally safe. The TFS owns and is co-located with the database files.

This delineation allows for a number of configurations between the runtime library and the TFS.

Physically, the TFS functions may be called directly from within the runtime library in order to operate on database files that are visible to the application process. The TFS functions may also be wrapped into a server process and called through a Remote Procedure Call (RPC) mechanism on the behalf of runtime libraries that are executing within other processes. This distinction between local and remote access to the TFS functions is called "embed" or "remote", and the application programmer may choose between them.

The "embed" configuration is used when an application process with one or more threads uses a database that is not shared with other processes. The "remote" configuration is used when the TFS functions are running within a server process.

By default, the "hybrid" configuration allows a runtime library to select an embedded or remote TFS at run time. It is possible to restrict an application to only embedded or only remote in order to save code space. The restriction is accomplished by using specific RDM libraries when linking the application. However, the default library permits the location of the TFS to be identified when a database is opened.

In the following sections, we will discuss the usage of the different TFS types.