I have one server running MongoDB which is on the internet, runs all the time.
I have two to five clients running in the same local network, runs only while C# application is running (3 hours a day).
What is the preferable strategy to keep the clients MongoDB up to date and also make it run individually without beeing able to connect to internet MongoDB server?
Also it could happen that one client is not running for a week or so and should still be updated to the latest state from the internet MongoDB server.
Is a replica set the way to go? Or would it be better to implement the update process of the clients in C# since this is not really the idea of a replica set?
Ideas are welcome.
Best How To :
the clients MongoDB
A client machine shouldn't run a MongoDB. MongoDB is not an embedded database, it must be administered and is generally too aggressive in terms of memory usage for clients.
Is a replica set the way to go?
No. Replication is essentially "always-on". The members of a replica set are expected to be more or less online at all times. The other machines will have to keep a backlog of operations (oplog) so they can replay all of them once the slave comes back up, which is extremely inefficient if slaves are expected to be down.
Or would it be better to implement the update process of the clients in C# since this is not really the idea of a replica set?
Yes, this is typical client-logic. What I don't understand is why, under these circumstances, don't the clients always fetch the data from the server like every regular web application does? If the clients should be available offline (a la git), that introduces a whole different set of challenges, such as multi-version concurrency control ('branches'), which lies in the problem / application domain, but has little to do with the databases used.