Creation of two MongoDB instances in the same server with different versions as a service

Can I create two MongoDB instances in the same Virtual Machine which will run of different port numbers and will have different versions of mongo?
For example lets us suppose a default Mongo DB instance will run as a service in the port number of 27017 with the Mongo version of 4.4.2, I wish to run Mongo version of 6.0.2 in port number 27020 in the same virtual machine as a service. Is it possible?
If possible, what is the load on the VM regarding the Huge flow of data, Loss of data and is it a sustainable method to run on a production level Virtual Machine?

I am not Windows savvy, but you can definitively run more than one instances, each listening on different port. And if you can specify the full path name of the mongod executable when defining the service, the yes you may have different version. Note that instances have to store their data and logs in different directories.

As for

The load will be proportionally huge.

Total lost of data if not running replica set.

If the reason of running on a VM is to isolate the host OS from the OS running mongod, then it is fine to

But if it is to share hardware between multiple instances running on multiple VM on the same hardware then it is not something I would do.

1 Like