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 contents cannot be persisted. When the last client closes the database any changes since the last database persist request will be discarded. If no calls were made to persist the database, 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 a 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 by programmatically requesting the databases to be persisted.
In-memory Keep

The inmemory_keep option is similar to the inmemory_volatile option with the exception that the database will ONLY be discarded when the TFS handling this database is terminated.

In-memory Persist When the first client opens a database with the storage configuration option set to inmemory_persist, the TFS will look for a 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. In this case only changes made since the last time the database was persisted will need to be written to disk.