What's the difference?

By: Jefferson Hwang

The best explanation I've come across on how a container is different from a virtual machine is the notion of separation of concerns. Separation of concerns (SoC) is a design principle that dictates each section addresses a separate concern. A concern can range from a variety of scopes from "details of the hardware for an application" or "which class to instantiate". The result of something that embodies SoC is modularity.

So what concerns do virtual machines and containers address and how are they different?

A virtual machine is an emulation of a computer system. It's often used to run different operating systems. One example might be if you wanted to test a cross platform desktop application across a variety of operating systems you may want to utilize virtual machines.

A container, on the other hand, is your application and the dependencies your application needs to run. Your application, though tied to an operating system, doesn't necessarily care about needing the full resources and functionalities of the operating system; it's only concerned with being able to run the application. Containers group the immediate concerns for the application that are independent of the operating system. That's the difference!

https://embed.notionlytics.com/wt/ZXlKd1lXZGxTV1FpT2lJelpqVmpORFV4TXpVeU1EUTBNV1UzT0dFM01qTXpORFl4TVRJeVkySTNPU0lzSW5kdmNtdHpjR0ZqWlZSeVlXTnJaWEpKWkNJNklreFRjRGxFYmtwdE1ISktPVmxVUkU5eE0wcEdJbjA9