Is it safe to have Mongo replicas on single server? I am planning a minimum setup for a low traffic discussion forum. Everybody says to use replicas because otherwise I am in a risk of data loss. I see an advantage that I can add new more powerful node without a downtime. While I was reading Mongo performance best practices, I noticed this sentence:

With appropriate sizing and resource allocation using virtualization
or container technologies, multiple MongoDB processes can safely run
on a single physical server without contending for resources.

What do you think? Is it safe? If the server or disk dies then all replicas are down.
Replication is a risk mitigation strategy, amongst other purposes. If you understand those risks, and the consequences should they eventuate, and that's all acceptable in your context then by all means run multiple replicas on the same hardware.
For a dev environment I can imagine this would be OK. A hardware failure would affect one person only. Recovery is likely quick. Replication can be tested at minimal cost.
For production, however, it would be much riskier. Hardware failure brings down the whole service. Recovery requires more, and more invasive, intervention. Resuming normal service may take longer and violate RTO.
My reading of the paragraph quoted in the question is that performance will not be affected by having multiple processes on the the same VM host, as long as those VMs are appropriately configured. I don't read it as a recommendation but as &quot;you can do it this way if you like at it won't necessarily break.&quot; My point is that an application architect should also consider availability. That is covered in a separate paragraph

For availability, multiple members of the same replica set should not be co-located on the same physical hardware.