MongoDB – Single Server/Instance Deployment Guide

mongodb

I need a database for backends (for iOS apps). Those are mostly low-load demand applications and I like mongo for it's schemaless-ness. I'm looking to host both db and app server on a small digital-ocean instances.

I plan to:

  • run it under systemctl on debian probably
  • have periodic backups (not sure yet how)
  • make sure it's only accessible to localhost

Anything else I need to do, like maybe enable journaling? (if yes, how do I do it?). What else do I need to do so that my single-server mongod production deployment is decent?

Best Answer

I understand you want to deploy single instance of MongoDB for production. This is the the recommendation from MongoDB.

Use standalone instances for testing and development. Do not use these deployments, which lack replication and high availability, for production systems. For all production deployments use replica sets.

Details about installing MongoDB community edition here.

Details about backup here.

To enable journaling, start mongod with the --journal command line option. For 64-bit builds of mongod, journaling is enabled by default.

Details about journaling here and here.