Martin
Martin

Reputation: 321

Switching Meteor App from local database to remote/cloud database

I am trying to learn Meteor for deploying web apps. So far it seems really cool and really quick in terms of code.

I have gone through the to do app tutorial on the Meteor website. It, from what I can tell, uses a local instatiation of MongoDB. I am wondering how hard it is to take it and have it instead write its data to a Cloud database like in Google Cloud Engine or AWS.

The code for this completed app is here: https://github.com/martylavender/ToDo

Upvotes: 0

Views: 133

Answers (1)

Thai Tran
Thai Tran

Reputation: 9935

It is pretty simple to switch from the local to the remote Mongo in Meteor. All you need to do is just put 2 variables into the environment: MONGO_URL and MONGO_OPLOG_URL

MONGO_URL="mongodb://XXXX:XXXX/meteor" MONGO_OPLOG_URL="mongodb://XXXX:XXXX7/local" meteor 

MONGO_OPLOG_URL is for reactivity. Without it, you can still work with Meteor; however, the reactivity will take a lot longer. You have to setup your database as a replica set (if you setup your database manually). Some cloud service (mLab) requires you to pay a bit for the replica set

Upvotes: 1

Related Questions