I’m running a fairly simple dotnet8 WebApi using MongoDB as a repositroy. After some testing I found that the read speeds were greatly improved by deploying a MongoDB container alongside my application using k8s and populating the MongoDB container instance from a remote VM instance of MongoDB acting as a master. The population would be completed in the dotnet WebApi application startup (pretty gross).
My question is whether I could use Replica Sets
to manage the replication of data across a number of these WebApi/Mongo deployments, that can be spun up and down as required.
I understand this is not the desired intention of a Replica Set that would sit behind a single instance of a service acting as redundancy.
If this isn’t the case, is there a different technology or design I could try to implement this idea, if it’s even worth perusing???
The current process involves the WebApi fetching data from the master/remote DB and adding it to the local MOngoDB instance manually for each required Collection.
Everything is deployed to Azure using VisualStudio Pipelines.