Two big buzzwords in the cloud computing space are “Containers” and “Serverless” – but what are they? Are there really no servers involved, and what can I pop in my container?!
First off let’s have a look at Containers. Containers have exploded over the last couple of years with even Windows 2016 and Windows 10 have built in container support (Docker) in the OS these days.
Containers became popular because they simplify deployments, you package software and get a predictable, repeatable and immutable environment even when you move the container to a new machine, or between environments (dev to prod or shipping to customers). With all the container talk out there you’ll have seen two things mentioned – Docker and Kubernetes. So which do I need? Well both!
Docker – The containerisation platform
To quote Docker they are the “world’s leading containerisation platform”. It’s the software that runs the container. A great article on understanding the difference between a VM and a container can be found here.
Kubernetes – The orchestation platform
Kubernetes was created by Google back in 2014 as a management tool used to simplify the scalability of workloads using containers. It is designed to automate deploying, scaling and operating application containers. There are other management tools such as DockerSwarm and as usual they all have their pros and cons but Kubernetes does seem to have been widely adopted as the standard (especially by Microsoft).
So what’s the benefits of containers:
- Isolation and resource sharing – containers run on the same server and share the same resources but do not interact with each other. If an application crashes the other containers will keep running.
- Fast, very, very fast – containers are lightweight and start in less than a second as there is no OS boot.
- Platform agnostic – write once, run anywhere. Easily run applications on different environments reliability without having to worry about architecture.
- Density – containers do not require a separate operating system, they use up less resources (a VM could be using many GB just for the OS).
There are many others but this highlights some of main benefits that have seen containers become increasingly popular.
OK so as you’ve probably guessed serverless computing isn’t actually serverless (who new) it’s yet another cloud service where the provider handles all of the Server infrastructure on your behalf (so another PasS solution then). Serverless computing was first popularised by AWS with their Lambda offering and Microsoft now have their Azure Functions offering along with many more.
So what are the benefits of server less computing?
- You only pay only for the time and volume of traffic used to execute the code. Lambda breaks its time-based pricing down into increments of 100 milliseconds. You no longer need to pay for servers or containers to be up and running when you’re not using them.
- No need to spin up any servers, configure or patch them.
- With a standardised programming environment you can focus on writing code.
Again, these are just a few of the many benefits of running your code serverless.
So what’s the difference?
As you’ll see both containers and serverless have their benefits and neither replaces the other – infact you should have both in your sights. Serverless functions are suited to executing quick running code and not necessarily long-running tasks (don’t forget it’s charged by the time it’s executing). Zero infrastructure admin, but with this ease of use comes a lack of control over the environment executing the code.
Containers still very much have their place, especially if you need flexibility to install software with specific version requirements and runtimes but with flexibility comes admin overhead.
Hopefully that clears up the difference between containers and serverless and you can see both very much have their place! These are two technologies to definitely keep on top of.