In-memory databases run entirely in a named cache (that is, in the Adaptive Server memory space), without using disk storage for data or logs. Because an in-memory database does not require I/O, its performance can be much better than a traditional, disk-resident database. In-memory databases are not designed for recovery: their transaction logs are written to the cache and not to disk, and any data changes are lost if the database fails. In-memory databases perform transactional logging for runtime rollback, and for other operations such as firing triggers, deferred mode updates, replication, and so on.
Disk-resident databases write to disk, and ensure that the transactional properties of atomicity, consistency, integrity, and durability (known as the ACID properties) are maintained. Durability refers to the persistence of transactions after they have committed. A traditional Adaptive Server database, also known as disk-resident, operates at full durability by writing its transaction log to disk when a transaction commits. This, along with data pages being written periodically to disk, ensures that all committed transactions are durable.
In-memory databases do not write data or log to disk, and trade the guarantee of transaction durability for performance improvements. In the event of a database failure, in-memory databases cannot be recovered. If your applications require data recoverability following a server failure or a normal shutdown, consider using a traditional Adaptive Server database.
With support for relaxed durability, Sybase extends the performance benefits of an in-memory database to disk-resident databases. A disk-resident database operates at full durability to guarantee transactional recovery from a server failure. Relaxed-durability databases trade the full durability of committed transactions for enhanced runtime performance for transactional workloads.
The performance benefits of in-memory and relaxed-durability databases include:
An in-memory database does not wait for I/O.
Improved buffer and user log cache management, so you need incure the overhead of user log cache flushes and buffer management when Adaptive Server performs concurrent updates to the same data.
Runtime strategies that may avoid flushing in the user-log cache to the transaction log when the transaction commits or aborts. These strategies reduce the contention on in-memory log pages.
Support for minimally-logged DML operations that use in-memory logging techniques improves the performance of large-volume DML operations.
Adaptive Server version 15.5 and later allows you to create these types of databases (illustrated in Figure 1-1, below):
Disk-resident databases with durability set to full (this is the default, or traditional, Adaptive Server database)
User-created disk-resident temporary databases
In-memory user databases with durability set to no_recovery
User-created in-memory temporary databases with durability set to no_recovery
Disk-resident relaxed-durability databases with durability set to no_recovery or at_shutdown
Figure 1-1: Attributes of in-memory, relaxed-durability and disk-resident databases
*Greater than or equal to the cache size
See your Replication Server® documention for information about using in-memory and relaxed-durability databases and DML logging in a replicated environment.