Why Serverless is the right tool for your edge application infrastructure
Serverless came into existence in the year 2014, when AWS announced Lambda, “An event-driven computing service for dynamic applications.” Since its inception, Serverless became a trend and has been massively adopted by cloud providers and application developers.
So far, it is mostly used in cloud-native applications where the serverless platform (e.g., Lambda) dynamically allocates ephemeral compute resources to the workloads (business processes) which are triggered by a certain event. There is nothing new about event-driven architecture but with Serverless, an event can spawn an entirely new ephemeral compute is a very powerful concept.
In this blog post, we will be talking about “Edge” computing and its challenges which can be solved by Serverless computing, specifically Function-as-a-Service (FaaS).
We will start by defining Serverless, Edge, and Edge computing, some of the challenges with Edge computing, and how Serverless can help.
There are two broad perspectives of Serverless:
For application developers,
- Serverless is an architecture paradigm which uses dynamic event-driven ephemeral compute resources to process the workload. Hence, it enables the true pay-as-you-go model and brings down the cost, as servers are not statically attached to the workload.
- Serverless (e.g. FaaS) is friendly to developers, allowing them to focus on writing code and not have to concern themselves with the specifics of building docker container or VM images to execute their code. FaaS addresses these problems for the developers by making a function (the smallest unit of application logic written in a couple of code files) a primary citizen of the application platform, which can be deployed, managed, and scaled independently.
For cloud providers (FaaS platform provider)
- Servers (physical or virtual) are the foundation of any cloud business, but managing them is not fun, as they need lots of costly resources (human, physical space, software updates, electricity, etc.) to run. With FaaS, the cloud providers manage a pool of servers, whose computing cycles can be shared and leased among multiple consumers. Hence, there are fewer servers to manage, reducing OpEx and CapEx.
Now let’s explore Edge, Edge computing and associated challenges, as well as how Serverless can help.
Edge and Edge Computing
Like “Cloud,” Edge is a very confusing term, hence it deserves a good explanation.
The above diagram depicts the layered architecture of Edge computing. Edge is the nearest/first computing resources available to process data produced by the data source (e.g., the user) or the devices. Hence, Edge is a new computing paradigm which brings general-purpose compute closer to end-users and devices to process data nearer the source. Edge computing brings down the latency caused by moving data to the cloud, provides higher bandwidth for applications, and enables a better quality of experience for existing application users. There is a long list of Edge computing use cases, but instead of going through them I would like to refer to an article written by my colleague and friend Matt Caulfield:
While Edge computing is a great technology, it is full of challenges, below are the three most important ones which are relevant to this blog post.
Resource limitation: Resources (CPU, Memory, and Network) are limited in the Edge computing environment. This is because of size, high cost, and limited physical space available to deploy resources at the Edge. The traditional style applications use always-on static processes, which hold up resources without much client activity. The event-driven, dynamic compute characteristics of Serverless can be used to efficiently utilize the Edge resources. Hence, more workloads can be served by dynamically allocating resources.
Application deployment and portability: Application deployment is tricky, as there is no set standard to package the application. Depending on the technology used, packaging can be JAR, WAR, ZIP, BIN, docker image, and more. Next, the Edge computing platform must have the right runtime and dependencies to run the application. In FaaS, the code/function is everything that needs to be deployed and then the platform does all the heavy lifting of running the code. At the same time, functions can be packaged with extra libraries if required.
Agility and programmability: Programmability plays an important role when it comes to changing the application logic and repurposing the current compute for different use. FaaS can be very useful because it enables a more programmable Edge by providing APIs to manage the function/code lifecycle in an agile fashion.
Edge computing architecture brings great benefits, it brings general-purpose compute closer to the devices and the data source. Hence, computing can be done closer to the data source, which enables lower latency for applications and better user experience. As explained above, there are lots of challenges to incorporate Edge computing paradigm to real business applications. Serverless can overcome some of the challenges by enabling efficient resource utilization of limited Edge resources and a more agile and programmable Edge