Products Support Documentation Download
Using the RDM In-Memory Database (IMDB)

The RDM IMDB is designed to be very simple to use. There is no need for proprietary keywords in the database schema to utilize the IMDB instead of the on-disk engine. Instead, the developer sets an option prior to opening the database to configure and use the IMDB. This allows the same database to be used with either the on-disk engine or the IMDB.

IMDB Configuration Options

When a database is opened there are several options available to configure the RDM storage engine. If no option value is given RDM defaults to the on-disk engine. The different configurations inform the engine what actions to perform when the database is first opened and when the database is closed by the last client to have it open. All clients that have the database open simultaneously must use the same storage configuration options. In addition, it is required that clients simultaneously opening a database use as an identical schema (or no schema at all). The following storage configuration options are supported

On-disk

When the first client opens a database with no storage configuration option set, or the storage configuration option set to "ondisk" the on-disk engine will be used.

In-memory Volatile

When the first client opens a database with the storage configuration option set to inmemory_volatile, the newly created database is considered to be "throw away." Database content will only be saved by programmatically calling the rdm_dbPersistInMemory() API. When the last client closes the database any changes since the last call to rdm_dbPersistInMemory() will be discarded. If no calls were made to rdm_dbPersistInMemory() then the entire database is discarded. The RDM Transaction File Server (TFS) maintains an open count to determine when a database is first opened and when it is no longer in use by any clients.

In-memory Load

When the first client opens a database with the storage configuration option set to inmemory_load, the RDM TFS will look for an on-disk idindex and pack file. If they are found the in-memory database will be loaded with the current contents of the on-disk files. When the last client closes the database any updates will not be automatically be written to the on-disk files. Changes can be saved programmatically using the rdm_dbPersistInMemory() API.

In-memory Keep

When the first client opens a database with the storage configuration option set to inmemory_keep, it will be opened without any rows in any tables. When the last client closes the database any rows that have been added will be written to on-disk files. The entire contents of any existing on-disk files will be replaced by the in-memory contents. This is also true if the rdm_dbPersistInMemory() API is called.

In-memory Persist

When the first client opens a database with the storage configuration option set to inmemory_persist, the TFS will look for an on-disk-idindex and pack file. If they are found the in-memory database will be loaded with the current contents of the on-disk files. When the last client closes the database any rows that have been modified will be written to the on-disk files. At any time, changes can be persisted programmatically using the rdm_dbPersistInMemory() API, in this case only changes made since the last time the database was persisted will need to be written to disk.