career, serverless

Serverless: The New Way of Thinking

Last update:

I'm preparing the first CNCF meetup in Sarajevo and thinking about what would be interesting to present at the first meetup. Of course, I will talk a little bit about CNCF in general, but I want something interesting for the second talk. Something that will bring more developers to future CNCF meetups. And, as you can guess it will be about Serverless. I'm not expert in this area, but I like the idea. My colleague, Andan Rahic loves to write and talk about it. He will give us some introduction by comparing containers vs. Serverless from a DevOps standpoint. First, let's see how Serverless is changing the way how we think about application architecture.

Without Servers?

No. Serverless is a service. It means that you don't need to take care of underlying infrastructure. You only write applications and deploy them, so the way how we deliver software is also changing. But, Serverless also encourages different kind of architecture, event-driven.

Saying that Serverless will replace containers is misleading. It's event-driven architecture, an evolution of microservices. Both Serverless and microservices are using containers for better resources usage. The main difference is that Serverless is basically a short-lived function. It can provide one or both of the following:

  • Functions-as-a-Service (FaaS) - provides event-driven computing
  • Backend-as-a-Service (BaaS) - provides third-party APIs, for example Auth0 for authentication

You probably heard about AWS Lambda which is one of the first Serverless platforms. There are many others that you can find on CNCF Serverless landscape page. But, what about Kubernetes, as we already use it for containers? Kuberntetes also has the support for Serverless with platforms like kubeless or OpenFaaS that are easily deployable on your cluster.

To answer a question that some DevOps guys are asking, no, this doesn't mean that you will lose your job. If you are asking this, then maybe you are not that good at DevOps. Serverless takes DevOps to the next level.

All Things Together

At first, we deployed our applications on bare metal machines by using scripting languages like bash. Then we moved to VMs. Great configuration management tools also came along such as Puppet or Chef. And nowadays we are using containers to package our applications. For application deployment, we can still use configuration management tools, but it's not simple to manage a lot of containers with them. This is where container orchestration tools came in, like Docker Swarm and Kubernetes, now a de facto standard. This is the current stage of deploying our applications. Looks like a real deal, but we still need to manage infrastructure and this is where we need to improve. All major public cloud providers have a managed Kubernetes cluster, but nodes are not left behind.

Container orchestration tools didn't solve infrastructure management problem. Picking the instance type, autoscaling and all other problems you need to solve are still here. Services like AWS Fargate will help you to focus on your applications and this is where we all want to go, Serverless or not. Kubernetes is a great platform for any kind of applications, but managing it isn't fun. Kubernetes is important for modern software development. This is the first time that we all agreed to have one platform that works everywhere. Because of this, we will probably have a new application type. Kubernetes native application will become a thing and tools like Operator Framework will help us to get there.

We have flow in both directions. On one side we tend to use resources better as everything runs on a physical server. On the other side, we also change the way how we develop applications. And because of this, it looks so confusing and hard to understand all those buzzwords, DevOps, Cloud Native, Serverless, containers, microservices, etc.

Serverless will define the next era of modern IT. It's still at an early stage and requires a different kind of thinking. Not all applications can run on it whereas all of them can run on Kubernetes for example. So, where this leaves us? I think that we will see a mix of containers and Serverless applications for some time. The most interesting thing to me now is about different application design. We will use a different kind of architectures to connect all things together. Take Serverless Event Gateway for example where you can wire functions to HTTP endpoints, react to business events with Serverless functions, and share event subscriptions with other providers.

Summary

In the end, Serverless and containers will work together and not replace each other. It will be interesting to see how it will emerge and in which direction application development will go in the future. One thing is for sure, we will replace server provisioning, maintenance, upgrading with more interesting things. Stay tuned for the next one.