MongoDB configurations

Learn how to configure your MongoDB provider for Galaxy

Although Galaxy provides a free MongoDB service, it is not suitable for production usage. Because of that, we advise you to host one yourself. We recommend using a dedicated database hosting service such as ScaleGrid 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 the app settings file

MongoDB is configured using environment variables in your settings.json file. Refer to the environment variables section 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 section.
  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.

Configuring Oplog Tailing

Meteor can get real time updates from MongoDB by using oplog tailing. Oplog tailing involves reading 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. Refer to the environment variables section to find an example.

Learn more

Edit on GitHub
// search box