I am wanting to use MongoDB on my Windows Server and I am using the .NET code at:
https://github.com/atheken/NoRM/wiki/
I have 2 web servers that I need to host MongoDB on and keep the database on both instances in sync. What should I be looking at to accomplish this? It seems the master/slave replication option is ideal.
If I do this, can I keep my connection string as?
mongodb://localhost/MyDatabase?strict=false
Thanks for any help. This is my first attempt as using MongoDB.
MongoDB doesn't support this kind of peer-to-peer replication, only master-slave where data is always written to a primary database then sync'd out to secondary replicas. You can, however, distribute reads across the replicas by using the slaveOk option. Check out replica sets for more info. To distribute writes, take a look at sharding.
Also, it might not be ideal to host MongoDB and your web server on the same box. Mongo is greedy when it comes to memory, and if the database grows larger than available RAM then web server performance could really suffer.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With