Over a million developers have joined DZone.

Introduction to Serverless Computing

DZone's Guide to

Introduction to Serverless Computing

Serverless computing is one of the biggest new technologies coming into its own. Learn about how it works and various applications.

· Microservices Zone ·
Free Resource

Containerized Microservices require new monitoring. See why a new APM approach is needed to even see containerized applications.

What Is Serverless Computing?

"It's computing, Jim, but not as we know it."

In the early days of computing, the first mainframes filled a room. As technology has advanced, computers have got more powerful and smaller and smaller until they have become invisible and disappeared completely. Only kidding - there are still servers involved, so just what is serverless computing?

Source: stackify.com.

Serverless computing is the next stop on the continued abstraction of compute resources.

IaaS (Infrastructure as a Service) provides virtual servers available in the Cloud, but they are still servers.

PaaS (Platform as a Service) provides virtual application platforms such as Python Flask, Node JS Express and JAVA Spring Boot. This level of abstraction removes the need to manage the Operating System, but there is still the requirement to manage scalability and package a complete application for deployment to the platform. Although PaaS can be used for microservices, it was born out of SOA (Service Oriented Architecture) and does not provide the level of automation required for running a large number of microservices. Don't right off PaaS just yet, though. New products are introducing container orchestration platforms Kubernetes, Docker Swarm and OpenShift as PaaS solutions.

Finally, this brings us to Serverless Computing, taking compute resource abstraction to its logical conclusion.

Application of Serverless Computing

Think of an application as a collection of functionality packaged together and deployed on a platform. The monolith has all the separate functionality in one ginormous package deployed onto an equally humongous platform. Since it's difficult to change a monolith quickly, release cycles are prolonged. It's also inefficient to scale since the whole application has to be replicated - even if only some of the functionality is under heavy load.

Microservice applications split out the separate functional blocks into smaller packages and deploy them on lightweight containerized platforms. Each miniature application or microservice can be revised independently as long as it keeps its promises to other services using it. This is more efficient to scale because just the service under heavy load needs to be replicated. Each microservice still contains a number of functions (like create, update and delete; and typically includes a platform or framework such as Python Flask, Node JS Express or Java Spring Boot.

Why do you need the platform? It's just extra baggage to manage, functionally it does not add value, it's only an enabler that allows the real functionality to run. Why not consume that as a service as well and just run the functions? That is what serverless is: individual functions running in the Cloud or Functions as a Service (FaaS); the ultimate componentization of an application. Now the Cloud platform entirely abstracts everything the application code needs to run, automatically handling scalability, failover, load balancing, etc. There are still servers involved but the developers and operators do not need to be concerned with them as the responsibility is delegated to the Cloud provider; unless they choose to run their own FaaS platform.

Serverless or FaaS provides complete flexibility enabling discrete functions to be revisioned without redeploying the whole application, continuing to increase the velocity of application delivery. Discrete functions may be scaled efficiently without the overhead of replicating the platform and any other functions that would also be packaged in a microservice. The tradeoff is that there are many more moving parts to manage with very few standards on how to do that management. Latency may also be an issue, especially with functions that are not used that often, as there will be a delay while the function is loaded into the runtime to be executed. The Cloud providers also impose resource limits for each function making FaaS unsuitable for intensive tasks.

Serverless Computing Vendors

Amazon has the most recognized Serverless Computing offering with AWS Lambda. By using other AWS services with Lambda, you can create and run an entire application without allocating a single server.

There are additional vendors, though:

All of them enable you to deploy functions that are executed on-demand and billed by the millisecond of execution time - the more the function is called, the more it costs (if you don't use it, it's FREE!). it's like accessing and paying for computing power the same way as electricity.

There are also open source Serverless projects such as Kubeless, OpenFaaS, and Fn Project.

Finally, if you want some great tooling that makes getting started a whole lot easier, have a look at Serverless.com.

The Future of Serverless Computing

With most people still trying to get their head around containerized microservice applications, Serverless Computing has yet to become mainstream. However, the never-ending quest for more speed in the application delivery lifecycle makes Serverless Computing more desirable. Before those advantages can be fully realized, though, additional tooling is needed to make it easier to manage, monitor and debug Serverless Applications.

As the Serverless Computing services continue to mature and monitoring technologies emerge to manage performance, Serverless Computing should become more widely adopted.

Stay tuned - soon we'll examine AWS Lambda monitoring and tracing.

Automatically manage containers and microservices with better control and performance using Instana APM. Try it for yourself today.

serverless ,microservices ,aws

Published at DZone with permission of

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}