Today we are all talking about Containers and container based infrastructure. There is a lot of hype and noise about this topic. But what is this container technology? And how does it solve today problems?
I am using containers by myself and of course I am fascinated from this server technology. Containers can really simplify things. After more than 20 years in building server applications I have experienced many problems very closely.
I call it “
server technology“, which may sound a little strange to some. Are containers not more of a
cloud technology? And this is the one thing that really bothers me is this current hype. When I talk about containers many people think about this
Kubernetes thing. And this was the impulse to write this article.
What is Docker?
Why do we need a container technology? The most important reason in my view is the fact that it’s just very hard to manage servers. And here I speak exclusively of Linux servers. Not because Linux is particularly complicated, but because Linux is today the only relevant server system of the Internet. You need to worry about how to run a server on the Internet and how to protect it from attack. How to deal with network, firewall, storage, backups… . Once you’ve done that, it’s a waste to use this server for just one thing. Or to make a current trend: to use it only for one microservice.
But in 2006, Linux has developed a very interesting technology called ‘cgroups’. cgroups (abbreviated from control groups) is a Linux kernel feature that limits, accounts for, and isolates the resource usage (CPU, memory, disk I/O, network, etc.) of a collection of processes. This is the core technology of containers running on a Linux server. Again it’s not easy to use this cgroups if you are not very familiar with Linux kernel technologies. So this was one reason why cgroups are not well known.
And this is what Docker comes into the game. The docker project simply gives you a handy tool-set to manage cgroups on a Linux server. It is so easy to use that most people did not know they are working with a Linux kernel technology. Docker just helps us to run many services secured and isolated on one server. One core tool of Docker is the ‘Docker Swarm’. Docker Swarm allows you to connect different servers to a kind of cluster. This becomes important when you have more than one server to manage.
So when we talk about containers and specially about Docker, we basically always talk about a Linux kernel technology.
What is Kubernetes?
So now, what is Kubernetes and why do we need it? To understand this, you have to imagine the following scenario: You don’t have one or a dozen Linux servers to run, but thousands. And you do not run one microservice, but tens of thousands. I hope you’re currently not in such a situation. But companies like Google and Amazon are exactly in this situation. Therefore, these companies need a technology to operate such large environments. But basically, this operating platforms are also just about managing services based on Linux
cgroups.
Google has published such a technology under the name
Kubernetes. But this technology was not invented for the operation of a single web project in a small company. Although this is of course possible. But we normally also do not use a rocket to go on holiday.
Please don’t get me wrong – Kubernetes is a great technology and it’s great that this technology is freely accessible. But do you need this? For any reason, today everyone seems to believe that they need to use this technology for their own projects. Presumably to be as successful as Google and Amazon.
Why You Should Use Docker
So finally – why you should use docker instead of Kubernetes? As I explained before, when we talk about container technology, we talk about Linux kernel technology. You should gain a little experience with Linux if you want to use containers in your projects. Docker offers an ideal tool set to deal with the technology behind it (cgroups). This is the one reason I recommend Docker. The other reason is that you remain independent of a particular technology platform. Even if Kubernetes has a large and growing community it is not the same as with Linux. Kubernetes has a very strong connection to today’s Internet giants like Google, Amazon and Microsoft. With Kubernetes it is almost too easy to store your data into one of these platforms. Even if it seems tempting for most projects, Docker and Docker Swarm is often sufficient. It is clear simple and transparent. I think it is much better to run your own server with a technology that you can control and is not just convenient.
Also, it’s easy to build a lightweight Docker swarm environment with a lot of cool features and lots of functionality from existing management containers.
Take a look at the
open project “Imixs-Cloud” on Github.