- Storage >
- Storage Engines >
- In-Memory Storage Engine
In-Memory Storage Engine¶
On this page
Warning
The in-memory storage engine is currently in beta. Do not use in production.
Starting in MongoDB Enterprise 3.2, an in-memory storage engine is available in the 64-bit builds for beta-testing purposes. Other than some metadata and diagnoistic data, the in-memory storage engine does not maintain any on-disk data. By avoiding disk I/O, the in-memory storage engine allows for more predictable latency of database operations.
Specify In-Memory Storage Engine¶
To select the in-memory storage engine, specify:
- inMemory for the --storageEngine option, or the storage.engine setting if using a configuration file.
- --dbpath, or storage.dbPath if using a configuration file. Although the in-memory storage engine does not write data to the filesystem, it maintains in the --dbpath small metadata files and diagnostic data as well temporary files for building large indexes.
For example, from the command line:
mongod --storageEngine inMemory --dbpath <path>
Or, if using the YAML configuration file format:
storage:
engine: inMemory
dbPath: <path>
See inMemory Options for configuration options specific to this storage engine.
Warning
The in-memory storage engine does not persist data after process shutdown.
Concurrency¶
The in-memory storage engine uses document-level concurrency control for write operations. As a result, multiple clients can modify different documents of a collection at the same time.
Durability¶
The in-memory storage engine is non-persistent and does not write data to a persistent storage. As such, the concept of journal or waiting for data to become durable does not apply to the in-memory storage engine.
Write operations that specify a write concern journaled are acknowledged immediately. When an mongod instance shuts down, either as result of the shutdown command or due to a system error, recovery of in-memory data is impossible.
Thank you for your feedback!
We're sorry! You can Report a Problem to help us improve this page.