Introduction
As a developer, I have always used a virtual machine to isolate all my development and demonstration environments. As SQL Server 2019 CTP’s have been released on Docker containers I wanted to understand the differences between a Virtual Machine and a container
Virtual Machine Architecture
- A virtual machine (VM) is an emulation of a computer system. •The operating systems (“OS”) and their applications share hardware resources from a single host server or a pool of host servers
- Each VM requires its own underlying OS and the hardware is virtualized
- A hypervisor is software firmware or hardware that creates and runs VM’s
What is Docker
In Contrast to VM’s, all that a container requires is enough of an operating system, supporting programs, libraries and system resources to run a specific program.
With containers, you can create a portable, consistent operating environment for Development, Testing and Deployment
Does not need it’s own infrastructure in contrast to VM’s
- Docker runs on top your existing server
- Does not need it’s own infrastructure in contrast to VM’s
Differences between a Virtual Machine and Docker
Conclusion
Based on my research and experience, there are uses for virtual machines and Containers. I will discuss why VM’s or Containers are useful in the following sections
Virtual Machines
A virtual machine can still be used in a development environment in the following scenarios:
- The first scenario is when a sandbox environment is required to test performance and the security of your code and this code needs to be isolated from the host.
- You need to test the performance characteristics on different operating systems with different system resources
Docker
- Docker can be used in most cases to run as a development/demo environment
- Docker can be used to run code based on an older operating system that may not be supported as a VM
- The memory footprint of Docker / Containers is a lot smaller compared to Virtual Machines.
My final conclusion is that Containers should be used in almost all development scenarios. VM’s do have their place but all developers should consider learning Docker/Containers as they provide the most flexibility
As a continuation on topic I will add an article on how to install SQL Server 2019 on Docker