You hear about virtual machines, containers, docker and other stuff
What does all of this mean?
And how does it help what we have been working on?
Let's start from the beginning
What we have been doing from the start
We have been running servers applications on can be considered "bare metal"
What does that really mean?
Bare metal = your computer
Your computer contains a computer chip, RAM, a disk drive, and some other wiring to make it all work together
This is the "bare metal"
You have an operating system installed on top of your computer, typically Mac OS X, Windows, or Linux
Before Virtualization
"In a world before virtualization, servers would traditionally run one application on one server with one operating system. In the old system, the number of servers would continue to mount since every new app required its own server and operating system"
Each server would use only 12% of it's resources
Why not run multiple apps on a single box
We can do this by simply running multiple Flask applications on a single computer
Each application could have its own port
They could communicate with each other
Security and Performance
Imagine if you can't access your database because the web server that you hosted on the same computer was being overloaded
That wouldn't be a good situation, nor would it be very easy to figure out
Also imagine if your web server that is connected to the public internet got hacked. Now they are in your database as well
In addition, each application typically requires different levels of resources (CPU, RAM, Disk space) for optimum performance
After Virtualization
We now have the ability to build mutliple "virtual machines" on top of our a single "bare metal" server
Virtual Machines can have their own operating system with their own applications installed inside of it
Now we can run multiple isolated applications within the same bare metal server.
How is this possible?
The Hypervisor
Software layer that provides the API for VMs to access computer resources
Hypervisor can distribute underlying resources that VM needs
Hypervisor can be installed on "bare metal" or on top of an operating system
Now you can have multiple operating systems running multiple applications on the same box
Some Terminology
Bare Metal: Your physical machine
Virtual Machine (VM): Emulation of a real computer that executes real computer programs. Also emulates drivers and RAM and hard disk and lso on
Hypervisor: Piece of software, firmware, or hardware that VMs run on top of. Provides API for VMs to interact with "bare metal"
Some Terminology
Host Machine: Machine that provdes VMs with resources
Guest Machine: Virtual Machine that has been created on a guest machine
Hosted vs Bare Metal
Hosted Hypevisor:
Runs on top of an existing operating system of the host machine
VM's don't have direct access to computer's resources: must ask OS
Pro: Cross-Compatbility
Con: Performance
Bare metal Hypervisor:
Runs directly on the computer: no operating system required
Through this hypervisor VMs have direct access to computer's resources
Pro: Performance
Con: Cross-Compatibility
VM Stack
Alright, so what is a Container?
Now that we have specifically defined what a VM is, now we can talk about containers
A VM virtualizes hardware : as if you are running a separate machine ("guest machine") with distinct RAM, CPU, Memory, and so on
A Container provides operating system level virtualization.
Key difference is that a Container does not abstract hardware elements such as CPU, RAM, and disk space
Containers vs VMs
Big difference: Containers share the host system, or OS. Each container has their separate "user-space" to run
Benefits of Containers
Remember the goal is to run multiple isolated applications on the same hardware
VMs provide that but requires an operating system installed on each computer
That takes more resources especially if you are 1) running the same OS and 2) just want to run more applications
Containers essentially share the same OS accross all of them but are still isolated