Adding Multiple Clients

Is it a good idea to have multiple mongo clients when reading and writing data in MongoDB. For example, we currently have client in the following way (using .NET Mongo Driver):

var client = new MongoClient(configuration);
var _db = client.GetDatabase(_database);

I am planning to have two separate clients, one for reading and one for writing. Will it help in increasing the performance or will it help the performance negatively ?


Hi @Jason_Widener1,

I am not sure the reason to do so, eventually your database will go through same amount of reads and writes with double connections.

Each connection occupied memory and resources so I can see only negative impact.

What you can consider is changing the connection readPreference to read from secondary for example and this may potentially ease primary for writes , but be sure to understand that date might be staled as replication is async…


This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.