MongoDB balancer library
This library allows you to operate data in many mongodb hosts as in one.
THIS LIBRARY DON'T SYNCING DATA BETWEEN HOSTS!
Instead of this, mongodb-balancer operating many clusters as chunks of one cluster. E.g when you do "insert" command, library is selection least loaded cluster, and inserts data in this cluster.
That can help you to split your data into many servers, instead of buying good server with hard disk, full of terabytes of data.
How to use it!?
You can use it as native mongodb library! But here's some changes you need to remember:
- For connecting to multiple hosts you need to use
mongodb.connectMultiple
instead ofmongodb.connect
. As first argument it takes array of mongodb uris, as second - mongodb connection options (like in native driver). -
collection.find
function not returnsmongodb.Cursor
object, instead of that it returns processed array of results (like as afterCursor.toArray()
in native node driver).