You are on page 1of 11

contributed articles

DOI:10.1145/ 3368454
applications, largely due to the recent
The server is dead, long live the server. shift of enterprise application archi-
tectures to containers and microser-
BY PAUL CASTRO, VATCHE ISHAKIAN, vices.23 Using serverless gives pay-as-
you-go without additional work to start
VINOD MUTHUSAMY, AND ALEKSANDER SLOMINSKI
and stop server and is closer to original

The Rise of
expectations for cloud computing to
be treated like as a utility.2 Develop-
ers using serverless computing can get
cost savings and scalability without

Serverless
needing to havea high level of cloud
computing expertise that is time-con-
suming to acquire.
Due to its simplicity and economi-
cal advantages, serverless computing

Computing
is gaining popularity as reported by
the increasing rate of the “serverless”
search term by Google Trends. Its mar-
ket size is estimated to grow to 7.72 bil-
lion by 2021.10 Most prominent cloud
providers including Amazon, IBM,
Microsoft, Google, and others have al-
ready released serverless computing
capabilities with several additional
open source efforts driven by both in-
CL OUD COM PU T I NG I Ngeneral, and Infrastructure- dustry and academic institutions (for
example, see CNCF Serverless Cloud
as-a-Service (IaaS) in particular, have become widely Native Landscapea).
accepted and adopted paradigms for computing with From the perspective of an IaaS cus-
the offerings of virtual machines (VM) on demand. By tomer, the serverless paradigm shift
presents both an opportunity and a
2020, 67% of enterprise IT infrastructure and software risk. On the one hand, it provides de-
spending will be for cloud-based offerings.16 velopers with a simplified program-
ming model for creating cloud appli-
A major factor in the increased adoption of the cations that abstracts away most, if
cloud by enterprise IT was its pay-as-you-go model
where a customer pays only for resources leased a https://s.cncf.io/

from the cloud provider and have the ability to get key insights
as many resources as needed with no up-front cost
˽˽ Serverless computing takes the original
(elasticity).2 Unfortunately, the burden of scaling was promises of cloud computing and
delivers true pay only for resources
left for developers and system designers that typically used with almost infinite scalability
used overprovisioning techniques to handle sudden while hiding the details of how servers
are used and maintained.
surges in service requests. Studies of reported usage ˽˽ Serverless computing is a new cloud
of cloud resources in datacenters19 show a substantial computing paradigm with enormous
economic growth potential.
ILLUSTRATION BY PETER BOLLINGER

gap between the resources that cloud customers ˽˽ Serverless computing allows the
allocate and pay for (leasing VMs), and actual resource developer to focus on developing
business logic and gives the cloud
utilization (CPU, memory, and so on). provider additional control over
optimizing resources.
Serverless computing is emerging as a new and ˽˽ There are many technical challenges
compelling paradigm for the deployment of cloud and opportunities for research.

44 COMM UNICATIO NS O F THE AC M | D EC EM BER 201 9 | VO L . 62 | N O. 1 2


DEC E MB E R 2 0 1 9 | VO L. 6 2 | N O. 1 2 | C OM M U N IC AT ION S OF T HE ACM 45
contributed articles

not all, operational concerns. They no This cost model is very attractive to
longer have to worry about availabil- workloads that must run occasion-
ity, scalability, fault tolerance, over/ ally; serverless essentially supports
underprovisioning of VM resources, “scaling to zero” and avoid need to
managing servers, and other infra-
structure issues. Instead, they can fo- One of the major pay for idle servers. The big chal-
lenge for cloud providers is the need
cus on the business aspects of their
applications. The paradigm also low-
challenges slowing to schedule and optimize cloud re-
sources.
ers the cost of deploying cloud code the adoption ˲˲ Elasticity—scaling from zero to “in-
by charging for execution time rather
than resource allocation. On the oth-
of serverless is finity.” Since developers do not have
control over servers that run their code,
er hand, deploying such applications the lack of tools nor do they know the number of serv-
in a serverless platform is challenging
and requires relinquishing design de-
and frameworks. ers their code runs on, decisions about
scaling are left to cloud providers.
cisions to the platform provider that Developers do not need to write auto-
concern, among other things, quality- scaling policies or define how machine-
of-service (QoS) monitoring, scaling, level usage (CPU, memory, and so on)
and fault-tolerance properties. There translates to application usage. Instead
is a risk an application’s require- they depend on the cloud provider to
ments may evolve to conflict with the automatically start more parallel ex-
capabilities of the platform. ecutions when there is more demand
From the perspective of a cloud for it. Developers also can assume the
provider, serverless computing is an cloud provider will take care of main-
additional opportunity to control the tenance, security updates, availability
entire development stack, reduce and reliability monitoring of servers.
operational costs by efficient optimi- Serverless computing today typi-
zation and management of cloud re- cally favors small, self-contained units
sources, offer a platform that encour- of computation to make it easier to
ages the use of additional services in manage and scale in the cloud. A com-
their ecosystem, and lower the effort putation, which can be interrupted
required to author and manage cloud- or restarted, cannot depend on the
scale applications. cloud platform to maintain its state.
This inherently influences the server-
Defining Serverless Computing less computing programming models.
Serverless computing can be defined There is, however, no equivalent no-
by its name—less thinking (or caring) tion of scaling to zero when it comes
about servers. Developers do not need to state, since a persistent storage
to worry about low-level details of serv- layer is needed. However, even if the
ers management and scaling, and only implementation of a stateful service
pay for when processing requests or requires persistent storage, a provider
events. We define serverless as follows: can offer a pay-as-you-go pricing mod-
Serverless computing is a platform el that would make state management
that hides server usage from developers serverless. We are seeing providers re-
and runs code on-demand automatically leasing services that stretch the defini-
scaled and billed only for the time the tion of serverless, and the definition
code is running. may evolve over time. For example,
This definition captures the two key Amazon Aurora is a “serverless” data-
features of serverless computing: base service, which supports powerful
˲˲ Cost—billed only for what is run- auto-scaling capabilities but requires
ning (pay-as-you-go). As servers and minimum memory and CPU alloca-
their usage is not part of serverless tions and hence does not scale to zero
computing model, then it is natu- and has ongoing costs.b
ral to pay only when code is running The most natural way to use server-
and not for idle servers. As execution less computing is to provide a piece
time may be short, then it should be of code (function) to be executed by
charged in fine-grained time units the serverless computing platform.
(like hundreds of milliseconds) and It leads to the rise of Function-as-a-
developers do not need to pay for service (FaaS) platforms focused on
overhead of servers creation or de-
structions (such as VM booting time). b https://aws.amazon.com/rds/aurora/serverless/

46 COMMUNICATIO NS O F TH E AC M | D EC EM BER 201 9 | VO L . 62 | N O. 1 2


contributed articles

allowing small pieces of code repre- follows:c “A serverless solution is one deployment. Furthermore, serverless
sented as functions to run for limited that costs you nothing to run if nobody builds upon long-running trends and
amount of time (at most minutes), is using it (excluding data storage).” advances in both distributed systems,
with executions triggered by events or This definition highlights the most publish-subscribe systems, and event-
HTTP requests (or other triggers), and important characteristic of serverless driven programming models,12 includ-
not allowed to keep persistent state computing—pays-as-you-go. It assumes ing actor models,1 reactive program-
(as function may be restarted at any serverless computing is a subset of cloud ming,4 and active database systems.25
time). By limiting time of execution computing so auto-scaling is included Serverless platforms can be con-
and not allowing functions to keep and developers have no access to serv- sidered an evolution of Platform-as-
persistent state FaaS platforms can ers. CNCF and our definitions empha- a-Service (PaaS) as provided by plat-
be easily maintained and scaled by size not only pay-as-you-go or “scale to forms such as Cloud Foundry, Heroku,
service providers. Cloud providers can zero” aspects, but also the lack of need and Google App Engine (GAE). PaaS
allocate servers to run code as needed to manage servers. was defined by NISTe as “the capa-
and can stop servers after functions Another way to define serverless bility provided to the consumer is to
finish as they run for limited amount computing is by what functionality it deploy onto the cloud infrastructure
of time. If functions must maintain enables. Such an approach emphasizes consumer-created or acquired ap-
state, then they can use external ser- “serverless is really about the managed plications created using program-
vices to persist their state. services” and FaaS can be treated as ming languages and tools supported
FaaS is an embodiment of serverless cloud “glue,” as described by Steven by the provider. The consumer does
computing principles, which we define Faulkner (a senior software engineer not manage or control the underlying
as follows: at LinkedInd). It is “glue” that joins ap- cloud infrastructure including net-
Function-as-a-Service is a serverless plications composed of cloud services. work, servers, operating systems, or
computing platform where the unit of Such a definition addresses only a nar- storage, but has control over the de-
computation is a function that is execut- row set of use cases where serverless ployed applications and possibly ap-
ed in response to triggers such as events computing is used, while our defini- plication hosting environment con-
or HTTP requests. tion captures the important use cases, figurations.” In this definition, users
Our approach to defining server- which we will highlight in the accom- are expected to manage deployments
less is consistent with emerging panying sidebars. of applications and have control over
definitions of serverless from indus- All definitions share the observa- hosting environment configurations.
try. For example, Cloud Native Com- tion that the name ‘serverless com- Serverless FaaS, when compared to
puting Foundation (CNCF) defines puting’ does not mean servers are not this definition of PaaS, is removing user
serverless computing11 as “the con- used, but merely that developers can control over hosting to provide sim-
cept of building and running appli- leave most operational concerns of pler scaling and more attractive billing
cations that do not require server managing servers and other resources, model: the cloud provider controls the
management. It describes a finer- including provisioning, monitoring, hosting environment’s configuration,
grained deployment model where maintenance, scalability, and fault-tol- runs user-provided code only when it is
applications, bundled as one or erance to the cloud provider. invoked, and only bills for actual usage
more functions, are uploaded to a while hiding the complexity of scaling
platform and then executed, scaled, History and Related Work (in practice implementing auto-scaling
and billed in response to the exact The term ‘serverless’ can be traced to in PaaS is not easy and it is very difficult
demand needed at the moment.” its original meaning of not using servers to scale to zero). That is a significant
While our definition is close to the and typically referred to peer-to-peer change when compared to the previous
CNCF definition, we make a distinc- (P2P) software or client-side only solu- generation of PaaS (which could be con-
tion between serverless computing tions.28 In the cloud context, the cur- sidered first generation of PaaS) and it is
and providing functions as a unit of rent serverless landscape was intro- very attractive for PaaS users that do not
computation. As we discuss in the duced during an AWS re:Invent event need to pay for idle resources and avoid
research challenges section, it is in 2014.3 Since then, multiple cloud managing auto-scaling rules.
possible that serverless computing providers, industrial, and academic The main differentiators of server-
will expand to include additional institutions have introduced their own less platforms is transparent autoscal-
aspects that go beyond today’s rel- serverless platforms. Serverless seems ing and fine-grained resource charg-
atively restrictive stateless func- to be the natural progression following ing only when code is running. That
tions into possibly long-running recent advancements and adoption of should not to be confused with free-
and stateful execution of larger VM and container technologies, where usage quota, where limited monthly
compute units. However, today each step up the abstraction layers led resource quota is available, but count-
serverless and FaaS are often used to more lightweight units of computa- ed even if the application is not used.
interchangeably as they are close in tion in terms of resource consumption, For example, GAE Standard is priced in
meaning and FaaS is the most popu- cost, and speed of development and “instance hours”f and even if the app is
lar type of serverless computing.
Paul Johnston (co-founder of c http://bit.ly/2G3Hp1R e http://bit.ly/2lXCgkI
ServerlessDays) defined serverless as d http://bit.ly/2xzNEWB f http://bit.ly/2kuqZbh

DEC E MB E R 2 0 1 9 | VO L. 6 2 | N O. 1 2 | C OM M U N IC AT ION S OF T HE ACM 47


contributed articles

Table 1. Comparison of different choices for cloud as a service.

IaaS 1st Gen PaaS FaaS BaaS/SaaS


Expertise required High Medium Low Low
Developer Control/Customization allowed High Medium Low Very low
Scaling/Cost Requires high-level Requires high-level Auto-scaling to work Hidden from users,
of expertise to build of expertise to build load requested (function limits set based on
auto-scaling rules and auto-scaling rules calls), and only paying pricing and QoS
tune them and tune them for when running (scale
to zero)
Unit of work deployed Low-level infrastructure Packaged code that One function execution App-specific extensions
building blocks (VMs, is deployed and running
network, storage) as a service
Granularity of billing Medium to large Medium to large Very low granularity: Large: typically,
granularity: granularity: hundreds of subscription available
minutes to hours per minutes to hours per milliseconds of function based on maximum
resource to years for resource to years for execution time number of users
discount pricing discount pricing and billed in months

not used the instance is kept running. code, however, was typically limited to els of developer control over the infra-
Later, GAE added Flexible version mobile use cases. structure. In an IaaS model, the devel-
with a more fine-grained billing unit, Software-as-a-Service (SaaS) may oper has much more control over the
but still developers will be billed even support the server-side execution of resources, but is responsible for man-
if server is not used. That can lead to user-provided functions, but they are aging both the application code and
unexpected outcomes when the bill ar- executing in the context of an applica- operating the infrastructure. This gives
rives at the end of month for forgotten tion and hence limited to the applica- the developer great flexibility and the
test services.g tion domain. Some SaaS vendors allow ability to customize every aspect of the
Mobile Backend as-a-Service (MBaaS) the integration of arbitrary code hosted application and infrastructure, such
or more generalized Backend as-a- somewhere else and invoked via an API as administering VMs, managing ca-
Service (BaaS) bears a close resem- call. For example, this is approach is pacity and utilization, sizing the work-
blance to serverless computing. Some used by the Google Apps Marketplace loads, achieving fault tolerance and
of those services even provided “cloud in Google Apps for Work. high availability. PaaS abstracts away
functions” (for example, Facebook’s The boundaries defining serverless VMs and takes care of managing un-
now-defunct Parse Cloud Code). Such computing functionality overlaps with derlying operating systems and capac-
PaaS and SaaS. One way to categorize ity, but the developer is responsible for
g https://stackoverflow.com/questions/47125661/ serverless is to consider the varying lev- the full life cycle of the code that is de-

Figure 1. High-level serverless FaaS platform architecture.

Edge Master
Worker

UI function main() { code


return {payload:
Event Queue

'Hello World'};
Dispatcher

} code
API Gateway

Cloud Event Worker


Sources code code

48 COMMUNICATIO NS O F TH E AC M | D EC EM BER 201 9 | VO L . 62 | N O. 1 2


contributed articles

ployed and run by the platform, which Figure 2. A function written in JavaScript.
does not scale down to zero. SaaS rep-
resent the other end of the spectrum
where the developer has no control function main(params, context) {
over the infrastructure, and instead get return {payload: 'Hello, ' + params.name
access to prepackaged components. + ' from ' + params.place};
The developer is allowed to host code }
there, though that code may be tightly
coupled to the platform. BaaS is simil-
iar to SaaS in that the functionality is
targeting specific use cases and com- Table 2. Real-world applications that use serverless computing.
ponents, for example, MBaaS provide
backend functionality needed for mo-
Where is serverless
bile development such as managing used? What do they use serverless computing for?
push notifications, and when it allows Aegex Xamarin application that customers can use to monitor real-time sensor
developer to run code it is within that data from IoT devices.a
backend functionality (see Table 1). Abilisense Manages an IoT messaging platform for people with hearing difficulties.
They estimated they could handle all the monthly load for less than
Architecture $15 a month.b
The core functionality of a FaaS frame- A Cloud Guru Uses functions to perform protected actions such as payment processing
and triggering group emails. In 2017 they had around 200K users and
work is simply that of an event pro- estimated $0.14 to deliver video course to a user.c
cessing system, as shown in Figure 1. Coca-Cola Serverless Framework is a core component of The Coca-Cola Company's
The service manages a set of user de- initiative to reduce IT operational costs and deploy services faster.d One
fined functions (a.k.a actions). Once a particular use case is the use of serverless in their vending machine and
request is received over HTTP from an loyalty program, which managed to have 65% cost savings at 30 million hits
per month.e
event data source (a.k.a. triggers), the
Expedia Expedia did "over 2.3 billion Lambda calls per month" back in December
system determines which action(s) 2016. That number jumped 4.5 times year-over-year in 2017 (to 6.2 billion
should handle the event, create a new requests) and continues to rise in 2018.f Example applications include
container instance, send the event to integration of events for their CI/CD platforms, infrastructure governance
and autoscaling.g
the function instance, wait for a re-
Glucon Serverless mobile backend to reduce client app code size and avoid
sponse, gather execution logs, make
disruptions.h
the response available to the user, and
Heavywater Inc  Runs Website and training courses using serverless (majority of cost per
stop the function when it is no longer user is not serverless but storage of video). Serverless reduced their costs
needed. by 70%.i
The abstraction level provided by iRobot Backend for iRobot products.j
FaaS is unique: a short-running state- Postlight Mercury Web Parser is a new API from Postlight Labs that extracts
less function. This has proven to be meaningful content from Web page s. Serving 39 million requests for
$370/month, or: How We Reduced Our Hosting Costs by Two Orders of
both expressive enough to build useful Magnitude.k
applications, but simple enough to al- PyWren Map-reduce style framework for highly parallel analytics workloads.l
low the platform to autoscale in an ap- WeatherGods A mobile weather app that uses serverless as backend.m
plication agnostic manner. Santander Bank Electronic check processing. Less than $2 to process all paper checks
While the architecture is relatively within a year.n
simple, the challenge is to implement Financial Engines Mathematical calculations for evaluation and optimization of investment
such functionality while considering portfolios. 94% savings on cost approximately 110K annually.o
metrics such as cost, scalability, laten-
cy, and fault tolerance. To isolate the a http://bit.ly/2XCas2J
execution of functions from different b https://thenewstack.io/ibms-openwhisk-serverless/
users in a multitenant environment, c https://gotochgo.com/2017/sessions/61
container technologies,9 such as Docker, d http://bit.ly/2xCWYsO
e https://aws.amazon.com/serverless/videos/video-lambda-coca-cola/
are often used.
f http://bit.ly/2JktVAR
Upon the arrival of an event, the g https://www.youtube.com/watch?v=gT9x9LnU_rE
platform proceeds to validate the event h http://bit.ly/2lyLaoOs
ensuring it has the appropriate au- i http://bit.ly/2xzYE6t
thentication and authorization to ex- j https://aws.amazon.com/solutions/case-studies/irobot/
ecute. It also checks the resource lim- k http://bit.ly/2YQcUni
l http://pywren.io/
its for that particular event. Once the
m https://thenewstack.io/ibms-openwhisk-serverless/
event passes validation, the platform n http://bit.ly/2YHtsxY
the event is queued to be processed. A o https://aws.amazon.com/solutions/case-studies/financial-engines/
worker fetches the request, allocates
the appropriate container, copies over

DEC E MB E R 2 0 1 9 | VO L. 6 2 | N O. 1 2 | C OM M U N IC AT ION S OF T HE ACM 49


contributed articles

less computing frameworks for their


consumers. While the general properties
Use Case 1: (for example, memory, concurrent in-

Event Processing
vocations, maximum execution dura-
tion of a request) of these platforms
are relatively the same, the limits as set
One class of applications that exemplify the use of serverless is event-based by each cloud provider are different.
programming. The following use case shows an example of a bursty, compute-intensive
Note the limits on these properties are
workload popularized by AWS Lambda, and has become the “Hello, World” of
serverless computing. It is a simple image-processing event handler function. a moving target and are constantly
Netflix uses serverless functions to process video files (https://amzn.to/2xMtwAt). changing as new features and optimi-
The videos are uploaded to Amazon S3,23 which emits events that trigger Lambda zations are adopted by cloud provid-
functions that split the video and transcode them in parallel to different formats. The ers. Evaluating the performance of dif-
flow is depicted in the figure here.
The function is completely stateless and idempotent, which has the advantage that ferent serverless platforms to identify
in the case of failure (such as network problems accessing the S3 folder), the function the trade-offs has been a recent topic
can be executed again with no side effects. of investigation,17,20,26 and recent
While the example here is relatively simple, by combining serverless functions with benchmarks have been developed to
other services from the cloud provider, more complex applications can be developed,
for example, stream processing, filtering and transforming data on the fly, chatbots, compare the serverless offering by the
and Web applications. different cloud providers.h

Video processing. Programming Model


A typical FaaS programming model con-
sists of two major primitives: Action
New video Store and Trigger. An Action is a stateless
event Serverless function segments
Raw to split video into Video function that executes arbitrary code.
videos segments segments Actions can be invoked asynchronously
in which the invoker—caller request—
does not expect a response, or synchro-
New segment nously where the invoker expects a
event
Transcoded Serverless functions response as a result of the action execu-
toServerless
transcodefunctions
videos
videos to transcode videos tion. A Trigger is a class of events from
a variety of sources. Actions can be in-
voked directly via REST API, or execut-
ed based on a trigger. An event can also
trigger multiple functions (parallel
the function—use code from storage cloud functions, one can appropriately invocations), or the result of an action
use—into the container and executes cache the most important packages could also be a trigger of another func-
the event. The platform also manages across the node workers, thus leading tion (sequential invocations). Some
stopping and deallocating resources to reduced startup times.24 serverless frameworks provide higher-
for idle function instances. In typical serverless cloud offer- level programming abstractions for de-
Creating, instantiating, and destroy- ings, the only resource configuration velopers, such as function packaging,
ing a new container for each function customers are allowed to configure sequencing, and composition, which
invocation while can be expensive and is the size of main memory allocated may make it easier to construct more
introduces an overall latency, which is to a function. The system will allo- complex serverless apps.
referred to as the cold start problem. In cate other computational resources Currently, serverless frameworks ex-
contrast, warm containers are contain- (for example, CPU) in proportion to ecute a single main function that takes
ers that were already instantiated and the main memory size. The larger a dictionary (such as a JSON object) as
executed a function. Cold start prob- the size, the higher the CPU alloca- input and produces a dictionary as out-
lems can be mitigated by techniques tion. Resource usage is measured and put. They have limited expressiveness
such as maintaining a pool of uninstan- billed in small increments (for exam- as they are built to scale. To maximize
tiated stem cell containers, which are ple, 100ms) and users pay only for the scaling, serverless functions do not
containers that have been previously time and resources used when their maintain state between executions.
instantiated but not assigned to a par- functions are running. Instead, the developer can write code
ticular user, or reuse a warm container Several open source serverless com- in the function to retrieve and update
that have been previously invoked for puting frameworks are available from any needed state. The function is also
the same user.7 Another factor that can both industry and academia (for exam- able to access a context object that rep-
affect the latency is the reliance of the ple, Kubeless, OpenLambda, Open- resents the environment in which the
user function on particular libraries (for Whisk, OpenFaaS). In addition, ma- function is running (such as a security
example, numpy) that must be down- jor cloud vendors such as Amazon, context). As shown in Figure 2, a func-
loaded and installed before function IBM, Google, and Microsoft have
invocation. To reduce startup time of publically available commercial server- h http://faasmark.com/

50 COMMUNICATIO NS O F TH E AC M | D EC EM BER 201 9 | VO L . 62 | N O. 1 2


contributed articles

tion written in JavaScript could take as


input a JSON object as the first param-
eter, and context as the second.
Current Cloud Provider Serverless
Use Case 2:
offerings support a wide variety pro-
gramming languages, including Java,
API Composition
Python, Swift, C#, and Node.js. Some Consider a mobile app that sequentially invokes a geolocation, weather, and language
translation APIs to render the weather forecast for a user’s current location. A short
of the platforms also support exten- serverless function can be used to invoke these APIs. Thus the mobile app avoids
sibility mechanisms for code written invoking multiple APIs over a potentially resource constrained mobile network
in any language as long as it is pack- connection, and offloads the filtering and aggregation logic to the backend. Glucon,
for example, used serverless in its conference scheduler application to minimize client
aged in a Docker image that supports
code, and avoid disruptions.
a well-defined API.
Due to the limited and stateless A serverless anti-pattern of offloading API calls from mobile app to backend.

nature of serverless functions, and its


suitability for composition of APIs,
Mobile app
cloud providers are offering an eco-
system of value added services that
support the different functionalities Lat/long 3 day weather
a developer may require, and is essen- coordinates forecast in French
tial for production ready applications. def main(dict):
For example, a function may need to zip = gis.geoToZip(dict.get("coords"))
forecasts = weather.forecast(zip)
retrieve state from permanent stor- firstThreeDays = forecasts[0:3]
translated = language.translate(firstThreeDays , ”en", ”fr")
age, such as a file server or database, return {"forecast": filter(translated)}
another may use a machine learning
service to perform some text analysis
or image recognition. While the func-
tions themselves may scale due to the Language translation
CoordToZipCode service Weather forecast service
serverless guarantees, the underlying service
storage system itself must provide re-
liability and QoS guarantees to ensure Note the main function is acting as an orchestrator that is waiting for a response
smooth operation. from a function before invoking another, thus incurring a cost of execution while the
function is basically waiting for I/O. Such a pattern of programming is referred to as a
serverless anti-pattern.
Tools and Frameworks
The serverless programming approach would be to encapsulate each API call as
One of the major challenges slowing serverless function, and the chain the invocation of these functions in a sequence. The
the adoption of serverless is the lack of sequence itself behaves as a composite function.
tools and frameworks. The tools and Offloading API calls and glue logic from mobile app to backend.
frameworks currently available can be
categorized as follows: development,
testing, debugging, deployment. Sever- Mobile App
al solutions been proposed to deal with
these categories.
Lat/long 3 day weather
Almost all cloud providers provide forecast in French
a cloud-based IDE, or extensions/pl-
ugins to popular IDEs that allows the
Language Translation
developer to code and deploy server- CoordToZipCode service Weather Forecast Service
Service
less functions. They also provide a lo-
cal containerized environment with an composite function
SDK that allows the developer to devel-
op and test locally serverless functions More complex orchestrations can use technologies like AWS Step Functions and
before deploying it in a cloud setting. IBM Composer to prevent serverless anti-patterns but may incur additional costs due to
the services.
To enable debugging, function execu-
tion logs are available to the developer
and recent tools such as AWS X-Rayi tions, triggers, and services needed by plications. From an infrastructure
allow developers to detect potential the functions. Theses frameworks will perspective, serverless and more tra-
causes of the problem.22 Finally, there handle the deployment of these func- ditional architectures may be used in-
are open source frameworksj that allow tions to the cloud provider. terchangeably or in combination. The
developers to define serverless func- determination of when to use server-
Use Cases less will likely be influenced by other
i https://aws.amazon.com/xray/ Serverless computing has been uti- non-functional requirements, such as
j https://serverless.com/ lized to support a wide range of ap- the amount of control over operations

DEC E MB E R 2 0 1 9 | VO L. 6 2 | N O. 1 2 | C OM M U N IC AT ION S OF T HE ACM 51


contributed articles

Another class of applications that


exemplify the use of serverless is com-
Use Case 3: position of a number of APIs, control-

Map-Reduce Style Analytics


ling the flow of data between two ser-
vices, or simplify client-side code that
interacts by aggregating API calls (see
PyWren18 (illustrated in the figure) is a Python-based system that utilizes the serverless Use Case 2 sidebar).
framework to help users avoid the significant development and management overhead of
running MapReduce jobs. It is able to get up to 40TFLOPS peak performance from AWS Serverless computing may also turn
Lambda, using AWS S3 for storage and caching. A similar reference architecture has been out to be useful for scientific comput-
proposed by AWS Labs (https://github.com/awslabs/lambda-refarch-mapreduce). ing. Having ability to run functions
PyWren exemplifies a class of use cases that uses a serverless platform for highly
parallel analytics workloads.
and not worry about scaling and pay-
ing only for what is used can be very
Map + monolithic Reduce PyWren example implementing ImageNet Large Scale good for computational experiments.
Visual Recognition Challenge.
One class of applications that started
gaining momentum are compute in-
Output:
Input: tensive applications.13 Early results
classified
1.28M images Blob Store
images
show (see Use Case 3 sidebar) the per-
(S3) formance achieved is close to special-
ized optimized solutions and can be
done in an environment that scientists
prefer such as Python.
... If the workloads cannot be easily
PyWren map function:
PyWren mapS3 function: VM with Python divided into smaller units (such as
pull data from
Python
runpull map S3
data code
python from function: running a linear Python functions), then batch-oriented
runpull
Store data
python
result from
S3 S3
incode classifier using systems such as high-performance
run result
Store pythonincode
S3 NumPy and Intel MKL computing (HPC) or MapReduce clus-
cropping, scaling images libraries ters are a better option. If the demand
Store result in S3
for such clusters can be sustained,
for example, by having job queues
3000 lambda functions single r4.16xlarge VM
where jobs are submitted and sched-
uled based on available resources,
then workloads can be executed more
required, cost, as well as application ming. This includes applications that cheaply, albeit possibly taking longer
workload characteristics. exhibit event-driven and flow-like pro- to complete. The cost is lower than
From a cost perspective, the ben- cessing patterns (see Use Case 1 side- using FaaS as the service provider can
efits of a serverless architecture are bar of thumbnail creation). get cheaper VMs either by buying ac-
most apparent for bursty5,27 workloads. As a comparison, consider an tual servers, using vendor platforms
Bursty workloads fare well because the equivalent solution implemented as such as Databricks or BigQuery, or
developer offloads the elasticity of the an application running on a set of getting reserved VMs with longer con-
function to the platform, and just as provisioned VMs. The logic in the ap- tracts. If batch workloads can tolerate
important, the function can scale to plication to generate the thumbnails occasional restarts it may be better to
zero, so there is no cost to the consum- is relatively straightforward, but the run such workloads with on-demand
er when the system is idle. user must manage the VMs, includ- VMs (such as AWS spot instances).
There are many areas where ing monitoring traffic loads, auto- Many “born in cloud” companies
serverless computing is used today. scaling the application, and manag- build their services to take full advan-
Table 2 provides a representative ing failures. There is also a limit to tage of cloud services. Whenever pos-
list of different types of applications how quickly VMs can be added in sible they use existing cloud services
used in different domains along with response to bursty workloads, forc- and built their functionality using
a short description. We emphasize ing the user to forecast workload serverless computing. Before server-
this list is not exhaustive; we offer it patterns and pay for pre-provisioned less computing they would need to
to identify and discuss emerging pat- resources. The consequence is there use virtual machines and create auto-
terns. Interested readers can find ex- will always be idle resources, and it scaling policies. Serverless comput-
amples by going through additional is impossible to scale down to zero ing, with its ability to scale to zero and
use cases that are publically avail- VMs. In addition, there must be a almost infinite on-demand scalability,
able by cloud providers. component that monitors for chang- allows them to focus on putting busi-
From a programming model per- es to the S3 folder, and dispatch ness functionality in serverless func-
spective, the stateless nature of server- these change events to one of the ap- tions instead of becoming experts
less functions lends themselves to ap- plication instances. This dispatcher in low-level cloud infrastructure and
plication structure similar to those itself must be fault-tolerant and au- server management (see Use Case 4
found in functional reactive program- to-scale. sidebar for more details).

52 COMM UNICATIO NS O F THE AC M | D EC EM BER 201 9 | VO L . 62 | N O. 1 2


contributed articles

Challenges and Limitations


Serverless computing is a large step
forward, and is receiving a lot of at-
tention from industry and is starting
Use Case 4:
to gain traction among academics.
Changes are happening rapidly and
Multi-Tenant Cloud Services
we expect to see different evolutions A Cloud Guru is a company whose mission is to provide users with cloud training that
of what is serverless and FaaS. While includes videos. An important part of their business model is providing service on-
demand and optimizing delivery cost. Their usage patterns are unpredictable and may
there are many immediate innova- change depending on holidays or if they do promotions. They must be able to scale and
tion needs for serverless,6,14,15 there are to isolate users for security reasons while providing for each user backend functionality
significant challenges that need to be such as payment processing or sending email messages.
addressed to realize full potential
Requests are authenticated and routed to a custom function that runs in isolation and
to serverless computing. Based on with the user’s context.
discussions during a series serverless
workshops organized by the authors
Running in security
(https://www.serverlesscomputing.org/ context of User ABC
workshops/), and several academic21
Running in security
and industrial surveys (https://www.dig- context of User XYZ
italocean.com/currents/june-2018/), we
Video Files in
outline the following challenges: S3 Object
Programming models and tooling: Storage
since serverless functions are running User
for shorter amounts of time there ABC Gateway for
3
Custom Email 4 Sending Templated
authorization
will be multiple orders of magnitude 1 and request Sending Emails Service
User routing Function
more of them that compose applica-
XYZ
tions (for example, SparqTV; http:// 2
bit.ly/2xFktSb), a video-streaming Finalizing card
Credit Card
payment and
service runs more than 150 serverless Authentication
granting user
Payments
Service Service
functions). This however, will make it access function
more difficult to debug and identify
bottlenecks. Traditional tools that as-
sumed access to servers (for example, They achieve this by leveraging cloud services and serverless computing to build
root privilege) to monitor and debug a multi-tenant, secure, highly available, and scalable solution that can run each
applications are not applicable for user specific code as serverless functions (http://bit.ly/2JyPfBK). This dramatically
simplifies how a multi-tenant solution is architected as shown in the figure. A
serverless applications, and new ap- typical flow starts with a user making a request (1) from a frontend application (Web
proaches are needed. Although some browser). The request is authenticated (2) by using an external service and then
of these tools are starting to become sent either to a cloud service (such as object store to provide video files) or (3) to a
available, higher-level development serverless function. The function makes necessary customizations and typically
invokes other functions or (4) cloud services.
IDEs, and tools for orchestrating and
composing applications, will be criti-
cal. In addition, the platform may be expected to emerge. In the mean- to zero are critical. A more fundamen-
need to be extended with different time, developers can use tools and tal question currently being examined
recovery semantics, such as at-least- frameworks that allow the use of dif- is if containers are the right abstrac-
once or at-most-once, or more sophis- ferent serverless computing provid- tions for running serverless applica-
ticated concurrency semantics, such ers interchangeably. tions and whether abstractions with
as atomicity where function execu- smaller footprints, such as uniker-
tions are serialized. As well, refactor- Research Opportunities nels, are more suitable.
ing functions (for example, splitting Since serverless is a new area, there are Legacy code in serverless: Serverless
and merging them), and reverting to many opportunities for the research application designs are fundamentally
older versions, must be fully support- community to address. We highlight different from typical legacy applica-
ed by the serverless platform. While some options: tions. The economical value of existing
these problems have received a lot System-level research opportunities: code represents a huge investment of
of attention from industry and aca- A key differentiator of serverless is the countless hours of developers coding
demia,22 there is still a lot of progress ability to scale to zero, and not charge and debugging software. One of the
to be made. the customers for idle time. Scaling most important problems may be to
Lack of standards and vendor to zero, however, leads to problems what degree existing legacy code can
lock-in: Serverless computing and of cold starts, particularly for func- be automatically or semiautomatical-
FaaS are new and quickly changing tions with customized library require- ly decomposed into smaller-granulari-
and currently there are no standards. ments.17 Techniques to minimize the ty pieces to take advantage of these
As the area matures, standards can cold start problem while still scaling new economics.

DEC E MB E R 2 0 1 9 | VO L. 6 2 | N O. 1 2 | C OM M U N IC AT ION S OF T HE ACM 53


contributed articles

Stateful serverless: Current serverless examples of how developers are using cncf/wg-serverless#whitepaper
12. Etzioni, O. and Niblett, P. Event Processing in Action.
platforms are mostly stateless, and it is serverless to come up with new solu- Manning Publications Co., Greenwich, CT, 2010.
an open question if there will be inher- tions and applications. 13. Fouladi, S., Wahby, R.S., Shacklett, B.,
Balasubramaniam, K., Zeng, W., Bhalerao, R.,
ently stateful serverless applications in Sivaraman, A., Porter, G. and Winstein, K. Encoding,
the future with different degrees of QoS Conclusion fast and slow: Low-latency video processing using
thousands of tiny threads. NSDI (2017), 363–376
without sacrificing the scalability and Serverless computing is an evolution 14. Fox, G.C., Ishakian, V., Muthusamy, V. and Slominski,
fault-tolerance properties. in cloud application development, ex- A. Status of Serverless Computing and Function-as-
a-Service (FaaS) in Industry and Research. Technical
Service-level agreements (SLA): emplified by the Function-as-a-Service Report; arXiv:1708.08028, 2017
15. Hendrickson, S., Sturdevant, S., Harter, T., Venkataramani, V.,
Serverless computing is poised to model where users write small func- Arpaci-Dusseau, A.C., Arpaci-Dusseau, R.H. Serverless
make developing services easier, but tions, which are then managed by the computation with openlambda. In Proceeding of the 8th
USENIX Workshop on Hot Topics in Cloud Computing
providing QoS guarantees remains cloud platform. This model has proven (Denver, CO, USA, June 20–21, 2016).
difficult.17,27 While the serverless plat- useful in a number of application sce- 16. IDC. IDC FutureScape: Worldwide IT Industry 2017
Predictions. IDC #US41883016, 2016.
form needs to offer some guarantees narios ranging from event handlers 17. Ishakian, V., Muthusamy, V. and Slominski, A. Serving
of scalability, performance, and avail- with bursty invocation patterns, to deep learning models in a serverless platform. In
Proceedings of the IEEE Intern. Conf. on Cloud
ability, this is of little use if the ap- compute-intensive big data analytics. Engineering, 2018
plication relies on an ecosystem of Serverless computing lowers the bar 18. Jonas, E., Pu, Q., Venkataraman, S., Stoica, I. and
Recht, B. Occupy the cloud: Distributed computing for
services, such as identity providers, for developers by delegating to the the 99%. In Proceedings of the 2017 Symp. on Cloud
messaging queues, and data persis- platform provider much of the opera- Computing.
19. Kilcioglu, C. Rao, J.M. Kannan, A. and McAfee, R.P.
tence, which are outside the control tional complexity of monitoring and Usage patterns and the economics of the public cloud.
of the serverless platform. To provide scaling large-scale applications. How- In Proceedings of the 26th Intern. Conf. World Wide
Web, 2017
certain QoS guarantees, the server- ever, the developer now needs to work 20. Lee, H., Satyam, K. and Fox, G.C. Evaluation of
less platform must communicate the around limitations on the stateless na- production serverless computing environments.
In Proceedings of IEEE Cloud Conf. Workshop on
required QoS requirements to the de- ture of their functions, and understand Serverless Computing (San Francisco, CA, 2018).
21. Leitner, P., Wittern, E., Spillner, J. and Hummer, W.
pendent components. Furthermore, how to map their application’s SLAs to A mixed-method empirical study of Function-as-a-
enforcement may be needed across those of the serverless platform and Service software development in industrial practice;
https://peerj.com/preprints/27005
functions and APIs, through the care- other dependent services. While many 22. Lin, W-T, Krintz, C., Wolski, R., Zhang, M., Cai, X., Li,
ful measurement of such services, ei- challenges remain, there have been T. and Xu, W. Tracking causal order in AWS lambda
applications. In Proceedings of the IEEE Intern. Conf.
ther through a third-party evaluation rapid advances in the tools and pro- on Cloud Engineering, 2018.
system, or self-reporting, to identify gramming models offered by industry, 23. NGINX. NGINX announces results of 2016 future of
application development and delivery survey; http://
the bottlenecks. academia, and open source projects. bit.ly/2YM27e2/.
Serverless at the edge: There is a 24. Oakes, E., Yang, L., Houck, K., Harter, T., Arpaci-
Dusseau, A.C. and Arpaci-Dusseau, R.H. Pipsqueak:
natural connection between server- References Lean Lambdas with large libraries. In Proceedings of
1. Agha, G. An overview of actor languages. In
less functions and edge computing Proceedings of the 1986 SIGPLAN Workshop on Object-
2017 IEEE 37th Intern. Conf. on Distributed Computing
Systems Workshops, 395–400.
as events are typically generated at Oriented Programming, 58–67. ACM, New York, NY. 25. Paton, N.W. and Díaz, O. Active database systems.
2. Armbrust, M. et al. A view of cloud computing. ACM Comput. Surv. 31, 1 (1999), 63–103.
the edge with the increased adoption Commun. ACM 53, 4 (2010), 50–58; https://m.cacm. 26. Wang, L., Li, M., Zhang, Y., Ristenpart, T. and Swift, M.
of IoT and other mobile devices. iRo- acm.org/magazines/2010/4/81493-a-view-of-cloud- Peeking behind the curtains of serverless platforms.
computing/fulltext In Proceedings of USENIX Annual Technical Conf.,
bot’s use of AWS Lambda and step 3. AWS re:invent 2014—(mbl202) new launch: Getting 2018, 133–146. USENIX Association.
functions for image recognition was started with AWS lambda; https://www.youtube.com/ 27. Yan, M., Castro, P., Cheng, P., Ishakian, V. Building a
watch?v=UFj27laTWQA. chatbot with serverless computing. In Proceedings of
described by Barga as an example 4. Bainomugisha, E., Carreton, A.L., . Cutsem, V., the 1st Intern. Workshop on Mashups of Things, 2016.
of an inherently distributed server- Mostinckx, S. and Meuter, W.D. A survey on reactive 28. Ye, W., Khan, A.I. and Kendall, E.A. Distributed
programming. ACM Comput. Surv. 45, 4 (Aug. 2013), network file storage for a serverless (P2P) network.
less application.8 Recently, Amazon 52:1–52:34. In Proceedings of the 11th IEEE Intern. Conf. on
extended its serverless capabilities 5. Baldini, I., Castro, P., Cheng, P., Fink, S., Ishakian, Networks, 2003, 343–347.
V., Mitchell, N., Muthusamy, V., Rabbah, R., Suter, P.
to an edge based cloud environment Cloud-native, event-based programming for mobile
applications. In Proceedings of the Intern. Conf. on
by releasing AWS Greengrass. Con- Mobile Software Engineering and Systems, 2016,
Paul Castro (castrop@us.ibm.com) is a research staff
member at IBM T.J. Watson Research Center in Yorktown
sequently, the code running at the 287–288. ACM, New York, NY. Heights, NY, USA.
6. Baldini, I. et al. Serverless computing: Current trends
edge, and in the cloud may not just and open problems. Research Advances in Cloud Vatche Ishakian (vishakian@bentley.edu) is an assistant
be embedded but virtualized to al- Computing, Springer, 2017, 1–20. professor at Bentley University, Waltham, MA, USA.
7. Baldini, I., Cheng, P., Fink, S.J., Mitchell, N., Muthusamy,
low movement between devices and V., Rabbah, R., Suter, P. and Tardieu, O. The serverless
Vinod Muthusamy (vmuthus@us.ibm.com) is a research
scientist at IBM Research AI in Austin, TX, USA.
cloud. That may lead to specific re- trilemma: Function composition for serverless
computing. In Proceedings of the 2017 ACM SIGPLAN Aleksander Slominski (https://aslom.net) is research
quirements that redefine cost. For Intern. Symp. on New Ideas, New Paradigms, and staff member in the Serverless Group in Cloud Platform,
example, energy usage may be more Reflections on Programming and Software. Cognitive Systems and Services Department at IBM T.J.
8. Barga, R.S. Serverless computing: Redefining the Watson Research Center in Yorktown Heights, NY, USA.
important than speed. cloud [Internet]. In Proceedings of the 1st Intern.
New serverless applications: The Workshop on Serverless Computing (Atlanta, GA, USA,
June 5, 2017); http://www.serverlesscomputing.org/
serverless programming model is in- wosc17/#keynote © 2019 ACM 0001-0782/19/12 $15.00
herently different, but that should be a 9. Bernstein, D. Containers and cloud: From LXC to
Docker to Kubernetes. IEEE Cloud Computing 1, 3
motivation to think about building—or (Sept. 2014), 81–84.
rebuilding—new and innovative solu- 10. Businesswire. $7.72 billion function-as-a-service
market 2017—Global forecast to 2021: Increasing Watch the authors discuss
tions that tap into what it can provide. shift from DevOps to serverless computing to drive this work in the exclusive
the overall Function-as-a-Service market; https:// Communications video.
Pywren,18 ExCamera,13 HPC, numerical bwnews.pr/2G3ZzQY. https://cacm.acm.org/videos/the-
analysis, and AI chatbots are but some 11. CNCF Serverless White Paper; https://github.com/ rise-of-serverless-computing

54 COM MUNICATIO NS O F TH E ACM | D EC EM BER 201 9 | VO L . 62 | N O. 1 2

You might also like