Skip to content

Commit 8717a65

Browse files
committed
Storage Engine
1 parent 8b733a4 commit 8717a65

File tree

3 files changed

+54
-1
lines changed

3 files changed

+54
-1
lines changed

README.md

Lines changed: 54 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1360,7 +1360,60 @@ When we say **schemaless**, we actually mean **dynamically typed schema**, as op
13601360
<b><a href="#">↥ back to top</a></b>
13611361
</div>
13621362
1363-
#### Q. ***What is a Storage Engine in MongoDB?***
1363+
## Q. ***What is a Storage Engine in MongoDB?***
1364+
1365+
The storage engine is the component of the database that is responsible for managing how data is stored, both in memory and on disk. MongoDB supports multiple storage engines, as different engines perform better for specific workloads.
1366+
1367+
**Example**: command to find storage engine
1368+
1369+
```js
1370+
> db.serverStatus().storageEngine
1371+
1372+
// Output
1373+
{
1374+
"name" : "wiredTiger",
1375+
"supportsCommittedReads" : true,
1376+
"oldestRequiredTimestampForCrashRecovery" : Timestamp(0, 0),
1377+
"supportsPendingDrops" : true,
1378+
"dropPendingIdents" : NumberLong(0),
1379+
"supportsTwoPhaseIndexBuild" : true,
1380+
"supportsSnapshotReadConcern" : true,
1381+
"readOnly" : false,
1382+
"persistent" : true,
1383+
"backupCursorOpen" : false
1384+
}
1385+
```
1386+
1387+
<p align="center">
1388+
<img src="assets/StorageEngine.png" alt="Storage Engine" />
1389+
</p>
1390+
1391+
MongoDB supports mainly 3 storage engines whose performance differ in accordance to some specific workloads. The storage engines are:
1392+
1393+
* WiredTiger Storage Engine
1394+
* In-Memory Storage Engine
1395+
* MMAPv1 Storage Engine
1396+
1397+
**1. WiredTiger Storage Engine**
1398+
1399+
`WiredTiger` is the default storage engine starting in MongoDB 3.2. It is well-suited for most workloads and is recommended for new deployments. WiredTiger provides a document-level concurrency model, checkpointing, and compression, among other features. The WiredTiger storage engine has both configurations of a `B-Tree` Based Engine and a `Log Structured Merge Tree` Based Engine.
1400+
1401+
**2. In-Memory Storage Engine**
1402+
1403+
In-Memory Storage Engine is available in MongoDB Enterprise. Rather than storing documents on-disk, it retains them in-memory for more predictable data latencies.
1404+
1405+
**3. MMAPv1 Storage Engine**
1406+
1407+
MMAPv1 is a B-tree based system which powers many of the functions such as storage interaction and memory management to the operating system. Its name comes from the fact that it uses memory mapped files to access data. It does so by directly loading and modifying file contents, which are in a virtual memory through a `mmap()` `syscall` methodology.
1408+
1409+
<p align="center">
1410+
<img src="assets/MONGO_SE1.png" alt="Storage Engine" width="600px" />
1411+
</p>
1412+
1413+
<div align="right">
1414+
<b><a href="#">↥ back to top</a></b>
1415+
</div>
1416+
13641417
#### Q. ***How to condense large volumes of data in Mongo?***
13651418
#### Q. ***Is it possible to update MongoDB field using value of another field?***
13661419
#### Q. ***How to check if a field contains a substring?***

assets/MONGO_SE1.png

14.6 KB
Loading

assets/StorageEngine.png

46.5 KB
Loading

0 commit comments

Comments
 (0)