I know we can configure the storage engine to be wiredTiger at instance level when we start mongod.
But can we also select the storage engine to be different for different collection or database?
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It only takes a minute to sign up.Sign up to join this community
You can only use a single storage engine type per
mongod instance. There is only a single
dbPath setting for a
mongod deployment, and you cannot mix & match data files from different storage engines within the same data path.
However, you can use different storage engine configurations within members of a replica set (for example, mmap primary and WiredTiger secondaries). If you do this, you should be wary of differences in performance and be sure to test thoroughly in a QA/staging environment with representative workload.
Another available option is to set storage-engine specific options when creating a collection. For example, you could override the instance-level defaults for WiredTiger and set different options for specific collections (i.e. higher level of compression, or perhaps no compression).