Day 23 - Serverless movement
Serverless computing was invented in order to address the challenges and complexities of managing infrastructure in traditional computing models. Let's explore this concept in more detail.
Today, we're going to be discussing the concept of serverless computing and how it can be used to deploy software products. This is the other side of the coin compared to yesterday, where we talked about Web Servers and why we need them.
Serverless computing is a way of building and running applications and services without the need to manage infrastructure. This means that developers do not have to worry about setting up and maintaining servers and can instead focus on writing and deploying code.
But before jumping into it, a small announcement! (super big actually)
📣 Upcoming course for HackerPM
I'm working on building a live, 2-week-long cohort-based course for Product Managers to learn technical concepts with ease and get ready for managing technical products. You’ll learn how to tackle a new technical product, how to do technical discovery together with your engineers as well as how to build long and sustaining relationships with them.
I’ve worked on this topic for the last 5 years working at leading scale-ups in the Nordics. Now I’d love to teach you. Fill out this survey to get on the waitlist & be the first to hear when enrollments open.
🎁 You'll also get a 10% discount on the final price (and 20% if you are a pro member of HackerPM).
Why Serverless?
After a small announcement, back to the topic. 🤓
Serverless computing was invented in order to address the challenges and complexities of managing infrastructure in traditional computing models. In the past, developers had to worry about setting up and maintaining servers, as well as scaling the infrastructure to meet the needs of their applications. This required a significant amount of time and effort and could be a barrier to getting applications to market quickly.
In a serverless model, the provider (such as AWS, Azure, or Google Cloud) is responsible for executing the code and scaling the application as needed. The provider charges for the actual execution of the code, rather than for a pre-allocated amount of computing resources. This can lead to cost savings, as the developer only pays for the resources that are actually used, rather than for a fixed amount of computing capacity.
Comparison to web servers
If you remember from yesterday's post, a web server software such as Apache or NGINX is a program that runs on a server and is responsible for handling HTTP requests and serving web content. In this model, the developer is responsible for setting up and maintaining the server and the web server software, as well as deploying the application code.
One key difference between serverless computing and web server software is the level of control and responsibility the developer has over the underlying infrastructure. With serverless computing, the provider is responsible for executing the code and scaling the application as needed, while with web server software the developer is responsible for setting up and maintaining the server and the web server software.
Another difference is the way that the developer is charged for the use of computing resources. In a serverless model, the developer is only charged for the actual execution of the code, rather than for a pre-allocated amount of computing resources. This can lead to cost savings, as the developer only pays for the resources that are actually used, rather than for a fixed amount of computing capacity.
Let's explore popular Serverless providers in the market.
Does serverless actually mean no servers?
Any program on the computer runs on the hardware, as well as serverless applications are run on the servers, but this part is not exposed to the developers and is self-managed by the vendors.
So in the end, the general mental model we have of how online software products work is still correct.
AWS Lambda
Amazon Web Services (AWS) Lambda is a serverless computing platform. It is a service that allows developers to run code without having to worry about the underlying infrastructure.
With AWS Lambda, developers can upload their code and the service will automatically execute it in response to specific events or triggers. These events or triggers can include things like a change in a database, a message arriving in a message queue, or a request to an API.
One of the key benefits of using AWS Lambda is that it automatically scales the execution of the code based on the number of incoming requests or events. This means that the developer does not have to worry about provisioning or managing servers, and can instead focus on writing and deploying code.
AWS Lambda is charged based on the number of requests for the function and the duration of the execution. This means that the developer only pays for the resources that are actually used, rather than for a fixed amount of computing capacity.
Link to Serverless page on AWS
As you'll notice, there are many different services only in Amazon Web Services to support "Serverless" architecture. We touched only Lambda as one of the key elements in the serverless package.
Google Cloud Functions
Google Cloud Functions is a serverless computing platform offered by Google Cloud. It allows developers to run code in response to specific events or triggers, without the need to worry about the underlying infrastructure.
Like AWS Lambda, Google Cloud Functions automatically scales the execution of the code based on the number of incoming requests or events.
Google Cloud Functions is charged based on the number of invocations of the function and the duration of the execution, just like AWS Lambda.
Comparison between Lambda, Cloud Functions, and Azure's Serverless offering
In one photo:
Other providers
AWS Lambda and Google Cloud Functions are only the tips of the Serverless iceberg. There are many more providers in the market, ranging from enterprise-grade to open-source ones. Here is a quick list of other popular serverless choices:
Azure Functions: A serverless computing platform offered by Microsoft Azure that allows developers to run code in response to specific events or triggers.
IBM Cloud Functions: A serverless computing platform offered by IBM Cloud that allows developers to run code in response to specific events or triggers.
Oracle Cloud Functions: A serverless computing platform offered by Oracle Cloud that allows developers to run code in response to specific events or triggers.
AWS Fargate: A fully managed container execution service offered by AWS that allows developers to deploy and run containerized applications without the need to worry about the underlying infrastructure.
Google Cloud Run: A fully managed serverless platform offered by Google Cloud that allows developers to deploy containerized applications.
Azure Container Instances: A serverless computing platform offered by Microsoft Azure that allows developers to deploy and run containerized applications.
The updated mental model for Serverless architecture
A quick recap:
Frontend frameworks to build the client-facing application.
The Serverless infrastructure to host the application logic (in comparison to a backend framework and web servers)
Databases and other libraries, if any (such as authentication, notification, ...) stay the same as before.
To be serverless or not? That's the question
Product managers should consider a number of factors when deciding whether to use a web server or a serverless architecture. Some of the key considerations include:
Cost: Serverless computing can be more cost-effective in some cases, as the developer is only charged for the actual execution of the code, rather than for a pre-allocated amount of computing resources.
Scalability: Serverless computing allows for automatic scaling of the application based on the number of incoming requests or events. This can be useful for applications that experience fluctuations in traffic.
Time to market: Serverless computing can allow for faster development and deployment of applications, as the developer does not have to worry about setting up and maintaining infrastructure.
Complexity: Serverless computing can be simpler for developers to use, as they do not have to worry about managing infrastructure.
Integration with other services: Some serverless platforms, such as AWS Lambda and Google Cloud Functions, offer a wide range of integrations with other services, which can be useful for building more complex applications.
Overall, serverless computing can be a cost-effective and efficient way to deploy applications, as it allows developers to focus on writing code and allows the provider to handle the underlying infrastructure.
Thank you for reading, and we hope you found this information helpful. Until next time!