I am using 2 databases to make my RESTful API work.
Say DB1 and DB2. Both of which are on the same database server i.e. myhost:27017
I can fetch from DB1 simply using
for example:
User = new Meteor.Collection(‘user’);
For the second one I am using :
var DB2 = new MongoInternals.RemoteCollectionDriver(“mongodb://Myhost:27017/DB2”);
MyCollection1 = new Meteor.Collection(‘Collection1’,{_driver:DB2});
Will this cause performance issues(delay) while fetching from DB2.
I haven’t tried this before, but the internals of the mongo connection method will be the same for both DB1 and DB2 in your example. DB1 is just the default and doesn’t require naming.
There shouldn’t be any extra delay over having both connections in the one DB
I don’t think you get oplog support unless you configure it like this:
var DB2 = new MongoInternals.RemoteCollectionDriver('mongodb://localhost:27017/DB2?replicaSet=rs0', {oplogUrl:'mongodb://localhost:27017/local?authSource=DB2'})
At least that’s how I have it. Haven’t touched it in long time and don’t quite remember.