Hi everyone,
I noticed there are at least two ways to connect two meteor apps.
Method 1:
Modify the MONGO_URL
s in the env of App1 and App2 to point to some external mongo instance.
Method 2:
Modify the MONGO_URL
in the env of App2 to point to a mongo instance, and have App1 connect to App2 through DDP.connect
, and then pass this into calls to Mongo.Collection
.
//in App1
App2 = DDP.connect('http://app2url.somedomain.com')
//App2 points to some mongo instance
PostsFromApp2 = new Mongo.Collection('posts', App2)
//does App1 point directly to the same mongo instance
//or is it pointing to App2?
Is there a key architectural difference between these two methods? For example, in Method 1, both apps point directly to mongo. In Method 2, does the 'posts'
data from App1 come from App2, which comes from mongo?
Any input is appreciated, thanks!