MongoDB: Can different databases be placed on separate drives? MongoDB: Can different databases be placed on separate drives? mongodb mongodb

MongoDB: Can different databases be placed on separate drives?


That's actually a pretty easy thing to do when using Linux:

  1. Activate the directoryPerDB config option
  2. Create the databases you need.
  3. Shut down the instance.
  4. Copy over the data from the individual database directories to the different block devices (disks, RAID arrays, Logical volumes, iSCSI targets and alike).
  5. Mount the respective block devices to their according positions beyond the dbpath directory (don't forget to add the according lines to /etc/fstab!)
  6. Restart mongod.

Edit: As a side note, I would like to add that you should not use Windows as OS for a production MongoDB. The available filesystems NTFS and ReFS perform horribly when compared to ext4 or XFS (the latter being the suggested filesystem for production, see the MongoDB production notes for details ). For this reason alone, I would suggest Linux. Another reason is the RAM used by rather unnecessary subsystems of Windows, like the GUI.