I'm curious if there are still valid reasons to use Virtual Machines instead of Docker or development containers when working on application development. I've heard that containers can be secured well enough that VMs aren't really necessary anymore. What do you all think?
5 Answers
Ultimately, it’s about the level of isolation you require for your project. VMs are definitely robust for certain use cases. Make sure to choose what's relevant for your specific needs.
For database work, I prefer using VMs or bare metal because it's easier to customize and optimize. While containers can work, they sometimes complicate things, especially if your pipeline doesn't match the production environment exactly. VMs allow you to better ensure consistency across setups.
Using VMs can save costs and improve speed, especially if set up right. I've seen companies run several VMs packed on EC2 with tailored AMIs. This setup helped them maintain low latency and handle high traffic efficiently, even though managing it was a major task. But honestly, this is pretty complex and not advisable for startups looking for simplicity.
VMs offer better isolation, especially for legacy systems. While containers are lightweight, they still share the kernel, which can be limiting depending on what you need. Both have their own advantages; it really depends on your requirements.
VMs can be useful in specific scenarios. If you're testing OS-level changes or playing around with kernel modules, a VM gives you a real OS that containers can't provide, since they share the host kernel. For true sandboxing, VMs make more sense.
Exactly! If an app needs a real OS, containers just won't cut it.

But if you bind mount the actual disk into a container, databases can perform well, too! It's about finding that balance that works for your requirements.