An in-memory database primarily relies on main memory for computer data storage.
- Main memory databases are faster than disk-optimized databases because disk access is slower than memory access, the internal optimization algorithms are simpler and execute fewer CPU instructions.
- Accessing data in memory eliminates seek-time when querying the data, which provides faster and more predictable performance than disk.
This tutorial shows a fundamental approach to create an in-memory database for a very simple model using NMemory.
NMemory library provides a class called Database which represents an in-memory database instance which can contain tables and stored procedures. The simplest way is to create an object of Database class.
You can also inherit Database class to define your own in-memory database.
And then create an object of your own class.
The database is created, but it doesn’t contain any table or stored procedure right now.