Virtual Machines or Containers? This is the question which may seem worth asking, since containers and Virtual Machines looks the same from the surface. But if we go deeper into it, we will know just how different containers and Virtual Machines are. Basically, the containers and the VMs both essentially do the same thing.
Well, there are lots of reasons. Consider the following major differences between Virtual Machines or Containers:
- Containers have less overhead. At best, you could run maybe 50 VMs on top of a single physical host—and you’d need a pretty powerful server to get to even that number. But because containers have less overhead, you could run hundreds on top of a single host.
- Containers are easier to work with. One of the coolest things about Docker containers is the way you can pull and run a container image in a few seconds. You could also download and set up a VM image from the internet, but that process is not as streamlined.
- Containers are more standardized. There are multiple VM platforms out there, each with its own way of doing things. Being an expert in, say, VMware doesn’t necessarily qualify you to work with KVM, too. But with containers, Docker’s dominance and the Open Container Initiative have helped to standardize the entire container stack. There’s less nuance to have to learn.
- Containers are more open. Some VM platforms, such as KVM, are open source. But most are commercial products, which are only partially or not at all open. In contrast, platforms such as Docker are completely open source. That makes containers the better choice if you’re worried about vendor lock-in—or if you just believe that open source is a better way to do things all around.
This doesn’t mean containers are always better than VMs, of course. In some situations, VMs are still a better choice. But overall, containers have a lot of good selling points, which make them a more attractive solution for virtualizing software than traditional VMs.