Are Containers Serverless?
Tags: devops, serverless, aws, cloud
Published: 2020-11-25 08:14:43

---
title: Are Containers Serverless?
published: true
date: 2020-11-25 08:00:00 UTC
tags: devops, serverless, aws, cloud
canonical_url: https://www.thedevcoach.co.uk/are-containers-serverless/
---

The cloud industry is evolving quickly right now, and when it comes to the big trends likes containers and serverless it can be hard to work out the difference.

**Are Containers Serverless? No. Containers are a method of packaging up an application with its dependencies, container technology does not typically mandate how the application is to be executed. However there are container platforms which allow you to execute containers in a way that is serverless.**

That definition might seem like a bit of a tongue twister, but I’m precise for a good reason, as it is important to understand clearly the boundaries of the two technologies. There’s some nuance involved in answering todays question, so let’s break things down. Let’s start with containers and what they are.

## What are Containers?

![Docker Logo](https://i2.wp.com/www.thedevcoach.co.uk/wp-content/uploads/2019/10/docker.png?resize=760%2C588&ssl=1)

Containers are a way to package up an application and it’s dependencies into a unit of software. You can think of a container as a recipe, or a set of instructions used to create an application.

In reality a container is just a special type of protected process which runs on a machine or server in a specific way. The reason everyone is so fanatical about containers relates to their ability to be ported, their portability.

Containers by design are portable, are easy to move between servers, and can be multiplied (scaled) easily when architected correctly. This ability to scale containers makes them popular in use cases which involve heavy load.

When people talk about containers, [Docker](https://www.docker.com/) will quickly enter the conversation. Docker is currently the most popular container technology. But, containers are a generic concept—not unique to Docker—and there are other options such as [rkt](https://coreos.com/rkt/docs/latest/).

In summary: containers are a way to package an application.

Now that we understand a bit more about containers, let’s introduce serverless into our discussion. What is serverless?

## What is Serverless?

![Lambda Logo](https://i1.wp.com/www.thedevcoach.co.uk/wp-content/uploads/2020/10/lambda.png?resize=760%2C499&ssl=1)

Serverless is a cloud execution model. In serverless, the cloud provider takes responsibility for the servers (the underlying machines) leaving the customer solely responsible for what is running on the machines.

With serverless there is a server (somewhere), it’s just not your concern.

When people talk about Serverless they often mean functions as a service (also known as FaaS). Functions relates entirely to the compute side of serverless, so simply put: FaaS is the running of application code in a serveress way.

But, serverless can be applied to all parts of the technology stack, not just compute. Aspects like databases can also be ran in a serverless way, check out [Aurora Serverless](https://aws.amazon.com/rds/aurora/serverless/) for an example of this.

Serverless doesn’t dictate how applications are packaged, but it does dictate how they run. For instance, [AWS Lambda](https://aws.amazon.com/lambda/) (which is the most widely used serverless service currently) uses zip files to bundle up applications for deployment.

In summary: serverless is a cloud execution model.

But that still might leave you wondering about your original question: “Are containers Serverless?”. And the answer is, it depends. Because it all depends on what cloud service the containers are running on. Let me explain.

## So, Are Containers Serverless?

What dictates whether containers are serverless or not is the way they are executed. Since containers are just processes—not full machines—containers need to be executed as part of an execution environment (a server).

With containers, you are given the option to either setup and manage your own server to deploy your containers, or you can use an existing managed service which will manage the server for you: serverless.

Services, such as [AWS Fargate](https://aws.amazon.com/fargate/) allow containers to be ran in a serverless way, where AWS takes care of the infrastructure and platform, and you, the customer, simply provide the container (application) to be ran.

So, to go back to our original question: Are containers Serverless? The short answer is no. But the long answer is, that it depends on the way you choose to hose and execute them.

## Containers Vs Serverless

Hopefully this article helped you out understanding a bit more about the differences between containers and serverless.

I hope you now see that’s it’s not so much an either/or type conversation when it comes to containers and serverless, as containers can be serverless, or not, it depends all on how they’re executed.

For more on Serverless development, be sure to check out: [Serverless: An Ultimate Guide](https://www.thedevcoach.co.uk/serverless-ultimate-guide/). And if you’re looking to get into cloud, it might be worth checking out my [Recommended Books & Courses For Cloud Engineering](https://www.thedevcoach.co.uk/recommended-resources/).

---

The post [Are Containers Serverless?](https://www.thedevcoach.co.uk/are-containers-serverless/) appeared first on [The Dev Coach](https://www.thedevcoach.co.uk).

If you’re interested in Cloud I write a monthly [newsletter for Cloud Software Engineers](https://newsletter.thedevcoach.co.uk). I spend the month digging around the internet for the best cloud engineering content and provide a monthly summary. I read every article I share, and I focus on fundamentals as much as possible.