Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

MongoDB sharded cluster vs MongoDB on Kubernetes

I’m deploying a simple Flask app using MongoDB in different VMs. For that I configured 2 config servers, 2 mongos instances and 2 shards with 2 replicas each (all of this in different VMs).

My question is simple, what is the difference between doing it this way (using 8 VMs without K8s) or doing it with a single VM and using Kubernetes to handle it all?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

The reason why you deploy multiple instances of each of these components is to increase your availability and tolerance to handle fault.

What you want to achieve is to spread those 8 servers across as many physical machines as you can. Ideally each of these components that you run multiples of (e.g. the config servers) should not run on the same physical machine.

If you run the 8 VMs on a single physical machine or deploying 8 Kubernetes pods on a k8s cluster of one physical machine, you are not gaining anything in terms of fault tolerance or increased availability of your cluster.

In that case you would only gain the benefits of using an elaborate orchestrator like kubernetes to manage your containers.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading