MongoDB Atlas with Meteor: Step-by-Step Guide

Recently published a step by step guide to using MongoDB Atlas with Meteor Galaxy (you can follow the guide even if you’re using different Meteor hosting options). Check it out here.

We have been using Atlas for some of our projects at OK GROW! since August and so far we have been enjoying the experience.

If you have any questions please don’t hesitate to ask. :slight_smile:

6 Likes

Very awesome! Cheers

Thanks for writing this up. I’ve had my eye on Atlas for a while and I look forward to hearing how it’s going performance-wise. I guess that’ll be the next post? :wink:

Hopefully, in the next article, we will include a performance aspect along with our experience to date.

I’d like to add that their support staff has been awesome so far, really fast in getting a response (hoping this continues). They also seem to be actively improving Atlas, I have noticed updates in their FAQ, Guide and also Atlas’s UI since signing up.

1 Like

Excuse me, I don’t know any experience with Mongo Hosting.
The price for create new one Cluster is for one database name.
Or we could create more database on One cluster???

Meteor by default only connects/uses 1 database in a cluster. But you can create multiple databases inside a cluster etc. if you wish or have other apps connecting to different DB’s in the same cluster.

The pricing has changed slightly since writing this article. You can get 1 free shared cluster which has limited functionality for dev purposes etc. which you could try out.

It’s free to signup to MongoDB Atlas and when setting up the cluster you can change all the params whilst showing you how this will effect costs! It is hands down the best experience I have had from the various DB hosting services out there that I have used in the past.

Hope this helps!

1 Like

@cfnelson Thanks, but after I create Cluster: myTesting, I can’t see/find any option to create database name.
But I try to use cmd to connect the cluster, It is work find with database name = cluster name.
(I use free testing account)
Could explain?

You can connect to the cluster via the shell and create a DB, see here for example. Atlas gives you the shell command to connect to your cluster which you can copy.

NOTE: There are some limitations to the free tiers -> M0 Free Tier and M2/M5 shared clusters have a maximum of 100 databases and 500 collections total. See here for full limitations.

If your trying to create additional databases via the UI, you can only do this with the Data Explorer as far as I am aware, which isn’t available for the free tier.

Very thanks again for your explain.
But now I have problem with Mup deploying config
Mup Config for Mongo Atlas
Please help me again.
Thanks

Original link is dead. You can find the article here instead

Article should still be valid/relevant, some additions to the MONGO_URL string may not be mentioned.

The below two field options may be more relevant/important to include in your MONGO_URL string depending on if your app is using Transactions (introduced in MongoDB 3.6).

MongoDB 4.0:

MongoDB 4.2:

  • &ssl=true option is deprecated in favour of using &tls=true

Note: retryWrites is enabled by default in MongoDB 4.2, so you no longer have to include the option in your MONGO_URL unless you want to disable retryable writes.

2 Likes

I am using atlas with mongo and it is working great, except when the clusters promote a secondary to be the new primary.

After the db does this, my servers loose connection.

The error I see is

Got exception while polling query, name=MongoTimeoutError
Got exception while polling query MongoTimeoutError: Server selection timed out after 10000 ms

Do you have any idea what causes this to happen?
I am using oplog aswell.

The connection strings I’m using are

MONGO_URL='mongodb+srv://<user>:<removed>@<daserver>.mongodb.net/<mydb>?authSource=admin&retryWrites=true&w=majority'
MONGO_OPLOG_URL='mongodb+srv://<user>:<removed>@<daserver>.mongodb.net/local?authSource=admin&retryWrites=true&w=majority'
1 Like

@Slavrix - I’m facing the exact same problem. Do you have any updates to share? Thanks!

1 Like

@romanws
What version of meteor are you using?

Updating meteor to 1.10.1 seems to have solved the issue for me, as it also includes an update to the mongo driver.

Thanks for the quick response, @Slavrix . I’m on 1.9.2. I’ll try upgrading.

Has anyone else seen issues with connecting to the same db from two different Meteor apps on galaxy?

I have a staging env and a prod that use the same db, but staging tells me the ip isn’t whitelisted despite having 0.0.0.0/0

I should mention that one of them is a normal url ie leveluptutorials.com where the other is a meteorapp.com url

I’m having a very long convo with Atlas support rn and would love to know if anyone else is experiencing this.

4 sites on galaxy.meteor.com

1 works, 3 don’t

Same build, same connection string, same ssl cert, different urls.

The error that it’s spitting out is saying the ip whitelist isn’t right, but after talking to Atlas support they are saying it’s an SSL handshake issue. I have no idea how to troubleshoot this.

If u introduce a new cert different from your current one for one of the broken sites - what impact does that have?

Will give that try. 2 of the broken ones are using Galaxy’s built in default cert with .meteorapp.com domains. That really seems like that is the problem. Atlas isn’t accepting the SSL from .meteorapp.com.

I wonder if anyone else is seeing this.