What is containerization?

What is containerization?

It is the first post on series related to installation and configuration of containers on the Microsoft Windows platform.

This series is for professionals who start their journey with the containers and use them with Microsoft SQL Server.

Introduction

As an IT specialist, you are probably familiar with virtual machines that are available on the market for some time. On the market usually, there are two main products that offer virtualization: VMware and Hyper-V. Even though I am sceptical regarding the installation of SQL Server on the virtual machines, this time you can hardly find any SQL Server installed on bare metal – almost all new installations are on the virtual machines. Virtual machines provide many benefits like:

  • Running software on a very specific version of Operating System
  • Experimentation with other operating systems
  • Testing specific version of the application without affecting your Operating System
  • Easier migration between physical boxes
  • Costs saving by enabling the possibility of building highly complex environments on the single physical host
  • etc.

Of course, all of the solutions also have some disadvantages – in the case of virtual machines, the main one is the need for running a whole Operating System.

Containers

Imagine that you can run your application without the need of running a separate Operating System – this approach is called containerization. The picture below shows the main differences between virtual machines (sometimes called hardware virtualization) and containers (called operating system virtualization).

enter image description here

Source: https://stackoverflow.com/questions/16047306/how-is-docker-different-from-a-virtual-machine

A container is a standard unit of software that contains code and all dependencies. Thanks to that you can easily and quickly deploy from one environment to another.

Docker

As mentioned above, containerization allows to run application isolated from the rest of the system and gives the impression that every application is running on its very own OS instance. Docker is software that enables running containers on a single operating system. In Windows Operating System Docker is based on Hyper-V (thus this role needs to enabled) and shows in Hyper-V manager as Virtual Machine.

Kubernetes

If you install Docker on several machines (even with different operating systems) you can leverage the main advantage of Kubernetes – nodes. Each installation of docker starts to play the role of the nodes in the Kubernetes cluster. Kubernetes allows you to automate all of the features of containers such as provisioning, networking, load-balancing, security, scaling, etc.

Why use Docker?

Let me show a few of the advantages of containerization that can convince you to use containers in professional work.
Imagine that you want to use your application on a different version of the operating system such as Windows, Linux, macOS. Having in mind all of the environmental variables that can cause different behaviour of an application can be overwhelming  – just to name different .NET, Java version, even different paths. Using Docker you can package your code to Docker image that is sealed, independent of the Operating System and guarantee the same behaviour on production.
Concluding, Docker image contains all dependencies, such as libraries, version od programming language, etc.

Why use Kubernetes?

Kubernetes gives additional benefits related to containers by automation. First, you need to create a cluster of nodes, and then Kubernetes takes control over the cluster and can decide if new containers are needed or some of them are redundant.

Containers and SQL Server

As you have probably heard already, SQL Server starting with version 2017 supports not only Windows Operating System but also Linux. Adding this information with Docker gives new possibilities with an approach to software development and testing. Before it was required to install SQL Server instance on Windows Operating System (described in a blog series from zero to dba), but can be problematic when you need clean installation for testing. On Windows, there is a limit of a maximum of 50 instances on a single OS.

With Docker, you can spin up SQL Server using specific version (like RTM, CU1, CU2 etc.) within seconds instead of minutes using the previous approach. This can be extended to certifying if an application is compliant with the new version of SQL Server or more streamlined migration from one version to the another.

Summary

Containers start to be very popular recently due to their main feature – images that abstracts Operating System version, dependencies on programing language version and other variables that can lead to issues on deployment in production systems. With Docker, you can deploy images locally, and with Kubernetes, you can automate the deployment process on the cluster.

Links

https://docs.microsoft.com/en-us/virtualization/hyper-v-on-windows/reference/hyper-v-architecture
https://www.vmware.com/content/dam/digitalmarketing/vmware/en/pdf/techpaper/ESXi_architecture.pdf
https://stackoverflow.com/questions/16047306/how-is-docker-different-from-a-virtual-machine
https://www.docker.com/resources/what-container#
https://kubernetes.io/

Previous ASF 025: Rob Farley interview
Next Last Week Reading (2019-10-06)

About author

Michal Sadowski
Michal Sadowski 13 posts

Senior Database Platform Engineer, leader of Krakow chapter of Data Community Krakow - PASS Chapter. With more than 10 years of experience in Microsoft technology, helps in advisory for performance optimization on database and application levels. Holds many Microsoft certificates including MCSA: Windows Server 2008/2012/2016, MCSA: SQL Server 2012/2014/2016, MCSE: Data Platform and MCT.

View all posts by this author →

You might also like

Starting as DBA from zero 0 Comments

Installation of Docker Desktop for Windows

It is the first post on series related to installation and configuration of Docker containers on the Microsoft Windows platform. This series is for professionals who start their journey with

Starting as DBA from zero 3 Comments

Preparation for SQL Server installation

It is a first post on series related to installation and configuration of SQL Server installations. This series is for professionals who starts their journey with SQL Server administration and

Starting as DBA from zero 2 Comments

Installation of SQL Server using GUI

It is a second post on series related to installation and configuration of SQL Server installations. This series is for professionals who starts their journey with SQL Server administration and

0 Comments

No Comments Yet!

You can be first to comment this post!

Leave a Reply