Objective
The storage engine is the primary component of MongoDB's management data store, and MongoDB supports a variety of storage engines, each of which fits into a specific scenario
Wiredtiger
Characteristics
1. version >= 3.2 default storage engine
2. Support for document-level concurrency
3. Implementing concurrency Control using MVCC (Multiversion Concurrency control)
4. Data can be recovered by snapshot
5. Priority write journal log to ensure data landing, stand-alone mode recommended to open Journal log
6. Support for collection and index data compression
7. Using the storage engine internal cache and file system cache
Applicable scenarios
Fits most scenes
MMAPv1
Characteristics
1. MongoDB first generation engine, based on file memory mapping (based on memory mapped files)
2. Systems that do not support Big-endian architectures
3. Recover data by writing journal log data frequently
4. Records are continuously stored on the hard disk
5. When updating, the content exceeds the allocated space, the record needs to move to the new location, the index rebuilds and produces the hard disk fragmentation, very time-consuming, try to avoid this situation
6. Record space allocation policy: 2 of the n-th side, applicable to the record may change the scene; original size, for scenarios that are not updated, such as logging
7. Use all system available cache, system control, can be recycled at any time, the higher the memory performance, the better
Applicable scenarios
High volume of reading and writing and some high volume updates
In-memory
Characteristics
1. Version >= 3.2.6 available, Enterprise Edition only support
2. The data used is stored in the cache and performs better than other storage engines
3. Support Document Lock
4. Need to allocate enough available memory
5. Persistent storage is not supported
Applicable scenarios
Small data volumes, temporary storage, data transfer scenarios
Resources
"1" MongoDB storage
https://docs.mongodb.com/manual/storage/
"2" Storage Engines
https://docs.mongodb.com/manual/core/storage-engines/
"3" Wiredtiger Storage Engine
https://docs.mongodb.com/manual/core/wiredtiger/
"4" MMAPv1 Storage Engine
https://docs.mongodb.com/manual/core/mmapv1/
"5" In-memory Storage Engine
https://docs.mongodb.com/manual/core/inmemory/
"6" Journaling
https://docs.mongodb.com/manual/core/journaling/
"7" Gridfs
https://docs.mongodb.com/manual/core/gridfs/
"8" Faq:mongodb Storage
https://docs.mongodb.com/manual/faq/storage/
MongoDB's storage Engine