Comparing Containers and Unikernel

comparing-containers-and-unikernel

 

Docker‘s recent acquisition of Unikernel Systems has sent pulses racing in the tech world. Though Unikernel technology is not yet fit for production use, it has the potential to kill containers in next 5 years or so. Let us see the major difference between VMs, Containers and Unikernel

Virtual Machines

VMs meant that multiple servers could run on the same box at the same time. This ensured that the expensive physical resources were utilized fully and efficiently. It helped the developers to keep the production like environment on their “local machines” ensuring the code developed on Dev machines run on production also. We just need to setup the enviornment once, after that we can create a template using that enviornment and launch as many machines  wherever we need.

Although VMs solve a lot of problems, there are few drawbacks. One of them is there is lot of duplication involved. Imagine you run two CentOS VMs on a server. Both of them contain complete CentOS installations , GNU apps and many other files. Only userdata will be different on these two VMs.  It is simply waste of storage.

Another problem with VMs is waste of CPU and RAM . We will have to dedicate X amount of RAM and Y amount of CPU cycles for each VM. This is not an efficient way of using computing resources.

Docker Containers

Containers, such as Docker, offer a more lightweight alternative to full-blown VMs. In many ways, they are similar to VMs. They provide a mostly self-contained environment for running code.  Docker containers helps to avoid duplication. It allows multiple containers share same OS , kernel and even filesystem with some customization.

Also ,the ability to support dense software deployments is another benefit over VMs. Docker containers are ideal for creating dense environments in which the host server’s resources are fully utilized but not over utilized. That’s because Docker containers don’t require to duplicate the functionality of the host OS by creating guest operating systems inside containers.

Unikernels

Unikernels are a lighter alternative for containers which is best suited  for microservices . A unikernel is a self-contained environment that contains only the low-level features that a microservice needs to function including kernel features.

This is possible because the environment uses a “library operating system”. In other words, every kernel feature is implemented in a low-level library. When the microservice code is compiled, it is packed together with the features it needs, and general features the microservice doesn’t use are stripped away.

The resulting bundle is much lighter than Containers and size can be as small as kilobytes , which is impossible with Docker containers. This will ensure very fast booting time , in milliseconds. And the microservice deployment time will be meassured in milliseconds instead of current “seconds” .

As Unikernels reduce the amount of code deployed, which reduces the attack surface, improving security of application.

Unikernel is a great technology, but it would be difficult for the developers to adapt it. Docker is much easier to work it. Hope Docker will extend the features of unikernels making it easy to adapt .

 
Author: , 0000-00-00