The Mongo Driver, No Failover and Compose.io's New MongoDB Offering

Compose.io has rolled out a new iteration of its MongoDB as a Service offering. And it seems that existing Node drivers don’t work with it (i.e.: support failover):

Some drivers like Node (and Meteor) are not able to handle failover between mongos nodes.

So they suggest that instead of using the usual connection string (with failover options):

mongodb://<user>:<password>@aws-us-east-1-portal.88.dblayer.com:88888,aws-us-east-1-portal.99.dblayer.com:99999/test-deployment-todos?ssl=true

… to use one of the following

mongodb://<user>:<password>@aws-us-east-1-portal.88.dblayer.com:88888/test-deployment-todos?ssl=true
mongodb://<user>:<password>@aws-us-east-1-portal.99.dblayer.com:99999/test-deployment-todos?ssl=true

which does not support failover scenarios.

I guess this was more of a statement than anything. The silly question that follows is… Any news about when we can expect driver support?

1 Like

Meteor uses the MongoDB Node.JS Driver; maybe try opening an issue with that project first (or submit a PR), to get it updated to support multiple hosts (without assuming it’s a replicaset).

For anyone else interested, there is a good breakdown of the issue here: Connecting to the new MongoDB at Compose

My application crashed today because of that. The primary db failed and galaxy did not handle the failover to default on the other possible base.

Any news on that?

Just had this happen to me too. Any resolution or tips to prevent in the future?

What version of Meteor are you using?

To the best of my knowledge there was an issue with an old version of the Nodejs MongoDB driver (== an old version of Meteor). However that was fixed over a year ago I think. I’ve not seen any issues with handling failover in a long time.

I was on 1.4.4.1…
Thanks for the follow-up. I’m looking into the Mongo Logs more now.