Introducing the new serverless paradigm

Look No Hands

© Lead Image © bolina, 123RF.com

© Lead Image © bolina, 123RF.com

Article from Issue 209/2018
Author(s):

Serverless computing takes cloud abstraction to a whole new level. Find out why more developers are turning to this exciting new programming paradigm.

Serverless is the next stage in the evolution of IT infrastructure. Serverless computing is a deployment model where functions or applications are uploaded to a platform and then executed, scaled, and billed in response to the demand needed for the moment. Users run their applications without spending resources on the complexity that comes with servers – provisioning, management, scaling, and more.

"The main drive behind this continuous evolution is to make it easier for a developer to focus on adding business value with their applications, without having to worry about the underlying infrastructure," says Peter Chadwick, director of product management for cloud and systems management at SUSE.

Serverless computing provides two different kinds of functionalities: Backend as a Service (BaaS) and Functions as a Service (FaaS). BaaS replaces the subset of custom server-side functions of an application with API-based, third-party services. A good example of BaaS is Google's Firebase. Firebase offers functionalities like analytics, databases, messaging, and crash reporting that can be plugged into an app through an API. Google runs and manages these services. A mobile developer doesn't have to worry about maintaining a "server." Google manages all of it, and you just pay when the application runs.

FaaS is a new way of deploying server-side software functions that can be triggered by events or HTTP API requests. According to an upcoming white paper by Cloud Native Computing Foundation (CNCF), developers deploy small units of code to FaaS, which are executed as needed as discrete actions, scaling without the need to manage the underlying infrastructure. This model removes the need for a virtual machine (VM) or a container. You just need an FaaS platform that runs these functions, which could consist of very basic code. FaaS is currently more popular than BaaS and is driving the adoption of serverless computing as an alternative for the IT industry.

Isn't That What PaaS Does?

If you think FaaS is trying to do what Platform as a Service (PaaS) projects like Cloud Foundry do – abstract the underlying infrastructure – you are not wrong. According to Chadwick, some customers taking their existing applications and put them in Cloud Foundry without rewriting everything. In theory, Cloud Foundry could be considered a FaaS platform.

From a developer's perspective, however, serverless offers a higher level of abstraction. PaaS abstracts the infrastructure and enables developers to create applications without worrying about the infrastructure. FaaS abstracts everything around the functions of that application. All you see is the function that you need to run. "It's a new architectural model for developers, where they decompose their applications into sets of functions that are triggered by events or HTTP API requests," says Docker's Patrick Chanezon.

Unlike traditional applications, these functions don't sit idle waiting to run. FaaS waits for the event to occur and then starts a container to run these functions; then it kills the container once it finishes its job. The developer has nothing to do with running the container – it is all done by the FaaS platform.

You can access a fully managed serverless platform through a cloud provider like Google [1], Amazon [2], or Microsoft [3], or you can build your own serverless solution using a locally hosted open source container platform. In either case, the technologies around FaaS are relatively new, and there is no standardization, so interoperability could be a challenge.

Event Horizon

FaaS allows the user to create functions and respond to events. Imagine a user has uploaded an image or video file to the server through a mobile app. That is an event that could trigger a function that runs image recognition code, creates a thumbnail, or sends the video file to another service. Another good use case for serverless is an Internet of Things (IoT) device; for example, a temperature sensor could create an event that triggers a function to instruct a thermostat to adjust the temperature.

As you might have noticed, this "serverless" platform isn't really serverless. A server is still back there, with all the complexity required to manage VMs or spinning containers, but FaaS hides all that complexity.

Back to the Future

To help users bring their traditional applications to the containerized world, players like Docker, IBM, and Microsoft have been working together to create solutions that help customers leverage technologies like serverless. Because serverless is a relatively new technology, the scope of use cases is still growing. Serverless is not a silver bullet for every application, but it is a great fit for a workload that sees sporadic demand, is concurrent, can be parallelized, and is asynchronous.

Serverless caters to developers who are more focused on the business logic and who want to scale out that business logic for the components that make up some of the application's back-end processes.

Batch processing is a good use case of serverless. "When you have a lot of data, such as images, you can send them in small batches that can then be processed one by one by serverless functions. IoT is another use case, where many events are happening, sending a great deal of data from devices. These events can trigger functions that can start a workflow," says Chanezon.

You may have noticed that Amazon Prime can provide you with information about the actors in a scene you are watching in a movie or TV show. This use case is well suited to serverless: The application can identify actors in each frame and pull relevant information from the database to display on the screen. Serverless can help a banking customer deposit a check using a mobile device that triggers a function when the device takes a picture of the check.

Machine learning will become a core part of serverless strategy, as it helps in automating all those triggers and actions. The possibilities are immense. "FaaS comes into play with back-end jobs that are very manual and task oriented," says CNCF's Ken Owens. "Companies can take those manual jobs and automate to create a smaller set of functions that can be independently scaled, deployed, and triggered."

Buy this article as PDF

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy Linux Magazine

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

comments powered by Disqus
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters

Support Our Work

Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.

Learn More

News