Serverless is an execution model for Cloud Computing. Serverless computing removes the complexities of managing infrastructure and shifts that complexity to a cloud provider, hence the term Serverless.
But learning Serverless isn’t easy. Today we’re going to cover the main aspects to Serverless that you need to know, including the main concepts of Serverless, the main tools that exist for using with Serverless and the different architectural patterns that you can use with Serverless.
By the end of this article you should understand what Serverless is, the benefits, and the main tools that you should know when it comes to Serverless.
In today’s article we’ll cover the following topics…
- What is Serverless?
- Serverless vs Functions
- Benefits of Serverless
- Drawbacks of Serverless
- Serverless & The 3 Big Cloud Providers
- The Serverless Framework
- 6 Concepts To Learn Before Serverless
- Serverless & Event-Driven (Async)
- Serverless Blogs / Podcasts
Ready to get going?
What is Serverless?
First, let’s start by defining what serverless is…
Serverless is computing is a cloud computing model where managing the infrastructure or servers behind a compute resource are shifted into a cloud provider. The key aspects of Serverless are that you only pay for what you use, and the scale of the software is managed by a cloud provider.
But before we continue, let’s cover a key point of confusion — and that’s how Serverless relates to other ideas such as Serverless databases and Function As A Service…
Serverless vs Functions
Before we get any further into understanding what Serverless is we should first discuss a key topic of confusion. And that’s: Does Serverless apply only to compute? Or also to other services?
The answer is that Serverless as a concept applies to any technology that can abstract it’s infrastructure concerns away and use on-demand pricing. A good example of this is AWS S3. That said, the common usage of the term Serverless is often used synonymously to refer to Serverless compute, or cloud functions.
For the rest of this article we’ll be talking more about the compute side of Serverless, as that’s what most people would expect, however it’s important to bear in mind that Serverless applies to other technologies and not just compute services.
Benefits of Serverless
No Infrastructure Maintenance
With typical server setups you would have to maintain underlying infrastructure, such as applying software patches to keep up with the latest versions, etc. With Serverless you don’t need to worry about the underlying infrastructure as that’s managed by your Cloud Provider.
In a typical server setup you would pay for the cost of your server whether it’s used or not. With Serverless you only pay for the resources that you use when you need them, which means you shouldn’t ever be paying for resources to sit idle. This is a key aspect for Serverless technology.
Cloud Native Integrations
Serverless technologies are inherently Cloud Native, which means they usually come out-of-the-box with many other cloud provider integrations, such as encryption methods, easy access to databases, integration with event systems and more. These integrations you might have to setup manually if you’re using a more server-oriented architecture.
But it’s not all sunshine and roses when it comes to Serverless, there are some drawbacks. Let’s take a look at those now…
Drawbacks of Serverless
Cloud Provider “Lock In”
Cloud lock-in is a huge topic in itself. When you use a Serverless technology you are by definition using a very high-level cloud provider service. The high-level nature of Serverless technology is what provides the main advantages but also one of the biggest disadvantage and that’s lock-in.
Serverless technologies are not by nature highly-portable, which means that moving between cloud providers isn’t necessarily very easy. This high-coupling to the cloud services can be off putting to some businesses who may want to reduce their dependencies on a single cloud provider.
Serverless & The Big 3 Cloud Providers
Each cloud provider has their own Serverless implementation with different pro’s and con’s. As Serverless is a high-level abstraction there is more scope for the cloud providers to interpret how to implement a Serverless service. All of the big three cloud providers provide their own Serverless compute implementations…
The Serverless Framework
There can be some confusion when it comes to Serverless with the company called Serverless Framework. The confusion on Serverless Framework not helped by the fact that they also managed to buy the domain serverless.com. Whilst related, the Serverless Framework is not related to the principles of Serverless at all.
The Serverless framework exists to try and make working with Serverless easier. Since there are many required moving parts to Serverless. An additional goal of the Serverless Framework is also to try and make it easier to port Serverless tools between Cloud Providers by proving some forms of common tooling.
6 Concepts To Learn Before Serverless
But before diving into Serverless, it helps to have at least a surface-level appreciation for the following topics…
- Infrastructure As Code — The practice of storing your infrastructure code in source control (For more, check out the Infrastructure As Code Ultimate Guide).
- A Cloud Provider — Understanding of at least one managed infrastructure service (For more, check out the AWS Ultimate Guide)
- Distributed Systems Concepts — Understanding of the difficulties in having components communicating via a network.
- Software Pipelines — An automated process for testing and packaging software components.
- Monitoring & Observability — The ability to remotely debug your software components.
- Microservices — An architecture practice of breaking down software components into independently deliverable parts.
Understanding these topics will help you navigate many of the nuances and difficulties of serverless technology.
Serverless & Event-Driven (Async)
Serverless architectures naturally lend themselves to event-driven (asynchronous) architecture. In an event-driven world software components react to events and emit events rather than issuing commands to other components. Events allow software components to be more de-coupled as no reference is made to the
One way of implementing event-driven architectures is with a queue. A queue is a software component that stores events to be processed at a later point in time. AWS for instance has the managed service SQS for this purpose. AWS Lambda can be easily configured to listen and poll events from an SQS queue.
But event-driven architectures come with added complexity. Business logic flows with events become more implicit as (theoretically at least) any software component can consume and process events, which can make it harder to understand business flows. Events also need additional concepts such as dead letter queues and retrying logic.
Serverless Blogs / Podcasts
Naturally as you learn more about Serverless you’ll start to wonder about where to get information on to stay up-to-date.
Below is a list of some prolific writers and podcasters in the Serverless space…
If you’re interested in learning more about Serverless I am currently in the process of putting together a free email course called Serverless with Lambda: Zero to Hero. You can already sign-up to register to receive the course when it’s released. Be sure to check it out…Find Out More
Become A Serverless Pro
And that concludes our look at Serverless for today. I hope that helped to clear up some of the confusion around Serverless for you.
If you’re itching to learn more about Serverless you can take a look through some of the past articles we’ve written on the topics you’re most curious about.
- Serverless on AWS Lambda: A Comprehensive Comparison Of Approaches (Serverless Framework vs SAM vs Terraform vs CloudFormation)
- 3 Simple Serverless Beginner Projects Ideas
- Misconceptions of Serverless: 5 Things You Thought AWS Lambda Did… But It Doesn’t.
- How to Use AWS KMS in AWS Lambda
- Master the AWS Lambda Console: A Comprehensive Walkthrough.
- AWS Queues And Lambda Processing: A Simple, Quick Walkthrough.
- How To Setup AWS Lambda Scheduled Events with Terraform
- How To Get AWS Lambda Logs Into CloudWatch
- Set Up AWS Lambda With An ALB (Load Balancer)
- AWS Lambda on Github Actions: How To Send Zipped Artifacts to AWS S3