MongoDB Pluggable Storage Engines WiredTiger

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Insert
> Step 2: And Like the video. BONUS: You can also share it!

Example

WiredTiger supports LSM trees to store indexes. LSM trees are faster for write operations when you need to write huge workloads of random inserts.

In WiredTiger, there is no in-place updates. If you need to update an element of a document, a new document will be inserted while the old document will be deleted.

WiredTiger also offers document-level concurrency. It assumes that two write operations will not affect the same document, but if it does, one operation will be rewind and executed later. That's a great performance boost if rewinds are rare.

WiredTiger supports Snappy and zLib algorithms for compression of data and indexes in the file system. Snappy is the default. It is less CPU-intensive but have a lower compression rate than zLib.

How to use WiredTiger Engine

mongod --storageEngine wiredTiger --dbpath <newWiredTigerDBPath>

Note:

  1. After mongodb 3.2, the default engine is WiredTiger.
  2. newWiredTigerDBPath should not contain data of another storage engine. To migrate your data, you have to dump them, and re-import them in the new storage engine.
    mongodump --out <exportDataDestination>
    mongod --storageEngine wiredTiger --dbpath <newWiredTigerDBPath>
    mongorestore <exportDataDestination>


Got any MongoDB Question?