Well, what I'm trying to get at is that the rails app should be doing this for you. I've got Alex beginning on a task that helps users setup and configure this tool suite when they download it. Part of that setup wizard will be 1) pick the database you want to monitor 2) pick the database where you want to mongo-tools to store everything - resulting in two db client instances total for everything in mongo-tools.

Rather than doing this on your own or attempting to manage these connections from within your background task where they really don't belong, we should push this to an application wide configuration and you guys should just be reading from the target client instance and writing to the mongo-tools client instance.

Make sense? We can totally talk about this more later today if it's not clear. What you have here is fine for now/development but obviously we want to do something different in the long run.