Virtual Machines and Containers - an overview

Photo by Melvin on Unsplash

Virtual Machines and Containers - an overview

·

3 min read

Deploying application on cloud

Cloud means the servers accessed over the internet. These clouds can have applications like projects we made with it's backend API and also something like databases which can be accessed over our computer or mobile phones.

When deploying our API to the cloud we can take two main approaches,

a . serverless - The cloud manages the configuration of the server and we don't worry about what operating system we will be using. Serverless approach is growing in popularity. 'AWS Lambda' is a popular serverless platform from Amazon

This is a basic understanding of how our lambda function works :

Event Source -----> Lambda Function(our Logic) ------> Services

If we are not very careful about how we are setting up our serverless architecture, we will face latency and higher response time.

b . Docker - It is being used extensively now and was released in 2014. Docker provides us tools so we can build containers and bundle and share our applications so they can run anywhere on any computer and server.

Virtual Machines

One familiar name as a virtual machine software is VMware.

Virtual Machines allow to run another operating system along with our own operating system. For now we should know that containers and virtual machines can run together to provide a great deal of flexibility.

In our virtual machine setup, following order is the architecture

  • virtual machine : a completely independent computer running in a window.
  • hypervisor : piece of software or hardware(in case of mobile phones) that allows to run multiple operating system on our device at the same time. We call them guest operating system.
  • infrastructure : server on the cloud or local computer/laptop

Hypervisor ensures that although we have a MacOS installed on our system, we can run Windows and Linux simultaneously on our device.

What is a Container?

As we build large scale applications, it becomes absolutely important that our APIs work on variety of environments.

Docker containers are small boxes containing our applications that run anywhere on our desktop.

We package our application along with all our dependency together and deploy them together in a well tested configuration and a well tested combination and then Docker allows our container to run on any environment.

Application Container

An application container is a stand alone, all in one package for a software application. Container contains application binaries, software dependencies and hardware requirements required to run the application, all in one independent unit.

Container makes use of the existing operating system on our computer.

Virtual Machines provide stronger isolation than containers because of extra layers. They provide a better sandbox than docker containers which prevent data leak.