Getting started

Scalability is an essential aspect of good software architecture. Therefore, system designers and architects spend quite a bit of time creating high performance and scalable software systems. Serverless architecture, in this context, can be considered a step ahead of traditional architectures, which usually require dealing with the infrastructure and resources of software and hardware. Compared to traditional architectures, serverless architecture entirely depends on a compute service, such as Amazon Web Services (AWS) Lambda or Google functions, and supporting APIs and products. These systems can scale and handle computational requirements without a need to manage individual servers and, therefore, can quickly enable product delivery to market while ensuring high performance and quality cloud services and architectures.

Serverless

"Serverless" does not mean that there are no servers involved when running the service. It simply means the servers have been abstracted away from the developers so they do not have to worry about them. In serverless computing, we usually use a compute service like AWS Lambda to execute our code or interact with an API. We still use servers—they're just hidden from the user. We no longer have to worry about the infrastructure and related software or system support. Serverless service providers look after such details for us, so that we can concentrate on our actual job: the application development.

Serverless is an approach that enables developers to focus on the code and not on the servers. Through this approach, the responsibility of the infrastructure administration doesn't fall on the developer, so there is no need for them to manage the server fleet, OS, and so on. The serverless approach provides the highest level of freedom from infrastructure management for developers.

What is serverless computing?

Cloud computing allows businesses to get rid of complex local infrastructure management by providing an abstraction of online services. It offers speed, efficiency, security, and data backup at reduced cost—all with flexible scalability.

There are different models of cloud computing, such as Platform as a Service (PaaS), Infrastructure as a Service (IaaS), Function as a Service (FaaS), and Software as a Service (SaaS). FaaS is also sometimes termed serverless, though FaaS is only one of the implementation models for serverless platforms.

Press + to interact
Different models of cloud services
Different models of cloud services

A serverless model is sometimes also called a pay-per-use model, or a metered service, and is well suited for use cases where the scale of an application’s event loads varies inconsistently with time, and event processing is not resource intensive.

Serverless computing is a deployment model that allows developers to build and run applications without having to manage servers. It describes a paradigm in which a provider handles the routine work of provisioning, maintaining, and scaling the server infrastructure, allowing developers to simply package and upload their code for deployment. Serverless applications may scale up and down automatically as needed, with no additional setup required by the developer.

Basics of serverless computing

Serverless applications allow us to execute code on demand using a compute service and do not require explicit interaction with servers. Usually, the code is written as single-purpose stateless functions and executed as push-based event pipelines. We can also use third-party services if needed.

Some important use cases of serverless architecture include:

  1. Automating infrastructure

  2. Building event-driven applications

  3. Building APIs, e.g., API with Amazon API Gateway

Importance of serverless computing

With the adoption of serverless frameworks in the software industry, a growing demand exists for professionals in this domain. According to Amine Barrak et al.Barrak, A., Petrillo, F., & Jaafar, F. (2022). Serverless on Machine Learning: A systematic mapping study. IEEE Access., serverless frameworks' share in the software market stood at around 3.33 billion USD in 2018 and is projected to reach 31.53 billion USD by 2026.

Press + to interact
Global serverless market
Global serverless market

This increase in the serverless market is partly due to the reduced TTM (time to market) and reduced development costs offered by the serverless computing paradigm. Moreover, it provides a fine-grained cost model and enhanced scalability, i.e., a flexible architecture for lightweight application development (or microservices) for use cases where service usage drastically varies with time. Advancement in the IoTInternet of Things domain, increasing demand for different mobile platform (iOS and Android in particular) applications, and evolving cloud infrastructure market offer lucrative opportunities in this field. However, the field does come with its challenges, such as lock-inInability to change or move services and data across vendors/ providers due to semantic mismatch of resources and services provided by different cloud providers., security, and compliance problems.

Major serverless service providers

A serverless framework involves two main roles:

  1. Developer: Writes code for serverless platforms, which gives the impression that there are no servers and that their code is always up and running.

  2. Provider: Provides serverless platform deployment.

The service provider must manage servers (or containers). Even while idle, the platform will incur some costs. A self-hosted system can also be considered serverless, where one team serves as the provider while the other serves as the developer.

The following is a list of some famous serverless providers:

  • Alibaba Cloud

  • Apache OpenWhisk

  • AWS

  • Cloudflare Workers

  • Google Cloud Platform

  • Knative

  • Kubeless

  • Microsoft Azure

  • Spotinst

  • Tencent Cloud

Serverless frameworks

While building a serverless application (e.g. using AWS Lambda, Azure Functions, or Google’s Cloud Run etc), we can use a serverless framework. There is a difference between a serverless service provider and a serverless framework. A serverless service provider provides serverless computing resources for deploying and running applications on their cloud infrastructure on a use-per-pay basis, without requiring us to do infrastructure handling. On the other hand, serverless framework is a tool/interpreter written in a particular programming language that provides support to make it convenient. It allows us to quickly write and deploy serverless applications using serverless resources (such as AWS Lambda or Google Cloud Functions and open-source or proprietary API gateways).

Therefore, a serverless framework is a deployment utility that allows us to deploy projects into serverless resources (such as AWS Lambda and API Gateway) with just a few lines of code without concerning ourselves with the servers. It automates deployment tasks and configuration and automatically sets up the required environment, providing developers with ease of mind.

The following is a list of some famous serverless frameworks:

  • Architect (Node.js, AWS)

  • AWS Serverless Application Model (SAM)

  • Chalice (Python, AWS Lambda)

  • Claudia.js (Node.js, AWS Lambda)

  • DEEP (Node.js, AWS)

  • Flogo (Go, AWS)

  • Lambda Framework (Java, AWS)

  • Serverless Framework

  • Sparta (Go, AWS)

  • Spring Cloud Function (Java, AWS/Azure/ OpenWhisk)

  • Terraform

  • Zappa (Python, AWS)