Learn how to configure your MongoDB provider for Galaxy

Since Galaxy doesn’t provide a MongoDB cluster, you will need to host one yourself. We recommend using a dedicated database hosting service such as mLab, Compose or MongoDB Atlas.

To configure MongoDB for your Meteor application, see the detailed steps in the Deployment guide.

For optimum performance, please ensure your database is running in the same region.

Configuring Oplog Tailing

Meteor can get real time updates from MongoDB by using oplog tailing. Oplog tailing involves reading the the MongoDB ‘operations log’ - a special Mongo collection that records all the write operations as they are applied to your database.

To use Oplog tailing, the database must be a Replica set enabled database. The sandbox database from mLab does not support Oplog tailing.

Configuring the app settings file

MongoDB is configured using environment variables in your ‘settings.json’ file. Refer to the environment variables section of the Help Center to find a complete example.

Note that a valid MONGO_URL is required unless you have removed the mongo package from your app. A missing/invalid MONGO_URL is a common cause of failed deployments.

Connecting to your database

Galaxy is agnostic about how you talk to MongoDB, as long as you provide the appropriate credentials. If you can’t connect, follow these steps:

  1. Review the settings and examples on the Environment variables page
  2. Try connecting without a Mongo Oplog URL to see if that is causing the issue
  3. Verify the URL and username/password by connecting through a MongoDB tool or CLI

If it still isn’t working, you may want to check GitHub and the forums, or write to your database provider. They’ll usually have more visibility into the issue than anyone in Galaxy support.

Learn more

Edit on GitHub