Optimizing Enterprise Economics Serverless Architectures
Optimizing Enterprise Economics Serverless Architectures
October 2017
© 2017, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Notices
This document is provided for informational purposes only. It represents AWS’s
current product offerings and practices as of the date of issue of this document,
which are subject to change without notice. Customers are responsible for
making their own independent assessment of the information in this document
and any use of AWS’s products or services, each of which is provided “as is”
without warranty of any kind, whether express or implied. This document does
not create any warranties, representations, contractual commitments,
conditions or assurances from AWS, its affiliates, suppliers or licensors. The
responsibilities and liabilities of AWS to its customers are controlled by AWS
agreements, and this document is not part of, nor does it modify, any agreement
between AWS and its customers.
Contents
Introduction 1
Understanding Serverless Applications 2
Serverless Application Use Cases 3
Is Serverless Always Appropriate? 5
Evaluating a Cloud Vendor’s Serverless Platform 6
The AWS Serverless Platform 9
AWS Serverless Platform Capabilities 10
Case Studies 13
Serverless Websites, Web Apps, and Mobile Backends 14
IoT Backends 15
Data Processing 15
Big Data 17
IT Automation 17
Additional Use Cases 18
Conclusion 18
Contributors 18
Further Reading 19
Reference Architectures 19
Document Revisions 19
Abstract
This whitepaper is intended to help Chief Information Officers (CIOs), Chief
Technology Officers (CTOs), and senior architects gain insight into serverless
architectures and their impact on time to market, team agility, and IT
economics. By eliminating idle, underutilized servers at the design level and
dramatically simplifying cloud-based software designs, serverless approaches
are rapidly changing the IT landscape.
This whitepaper covers the basics of serverless approaches and the AWS
serverless portfolio, and includes a number of case studies that illustrate how
existing companies are already gaining significant agility and economic benefits
from adopting serverless approaches. This paper illustrates how organizations
of all sizes can use serverless architectures to architect reactive, event-based
systems and quickly deliver cloud-native microservices at a fraction of
conventional costs.
Optimizing Enterprise Economics with Serverless Architectures
Introduction
Many companies are already gaining benefits from running applications in the
public cloud, including cost savings from pay-as-you-go billing and improved
agility through the use of on-demand IT resources. Multiple studies across
application types and industries have demonstrated that migrating existing
application architectures to the cloud lowers total cost of ownership (TCO) and
improves time to market. 1
Relative to on-premises and private cloud solutions, the public cloud makes it
significantly simpler to build, deploy, and manage fleets of servers and the
applications that run on them. However, companies today have additional
options beyond classic server or VM-based architectures to take advantage of
the public cloud. Although the cloud eliminates the need for companies to
purchase and maintain their own hardware, any server-based architecture still
requires them to architect for scalability and reliability. Plus, companies need to
own the challenges of patching and deploying to those server fleets as their
applications evolve. Moreover, they must scale their server fleets to account for
peak load and then attempt to scale them down when and where possible to
lower costs—all while protecting the experience of end users and the integrity of
internal systems. Idle, underutilized servers prove to be costly and wasteful.
Analysts estimate that as many as 85 percent of servers in practice have
underutilized capacity. 2
Serverless compute services like AWS Lambda are designed to address these
challenges by offering companies a different way of approaching application
design, one with inherently lower costs and faster time to market. AWS Lambda
eliminates the complexity of dealing with servers at all levels of the technology
stack, and introduces a pay-per-request billing model where there are no more
costs from idle compute capacity. Additionally, Lambda functions enable
organizations to easily adopt microservices architectures. Eliminating
infrastructure and moving to a Lambda model offers dual economic advantages:
• Problems like idle servers simply cease to exist, along with their
economic consequences. A serverless compute service like AWS Lambda
is never “cold” because charges only accrue when useful work is being
performed, with millisecond-level billing granularity.
Page 1
Optimizing Enterprise Economics with Serverless Architectures
Serverless apps are architected such that developers can focus on their core
competency—writing the actual business logic. Many of the app’s boilerplate
components, such as web servers, and all of the undifferentiated heavy lifting,
such as software to handle reliability and scaling, are completely abstracted
away from the developer. What’s left is a clean, functional approach where the
business logic is triggered only when required: a mobile user sending a message,
an image uploaded to the cloud, records arriving in a stream, and so forth. An
asynchronous, event-based approach to application design—while not
required—is very common in serverless applications, because it dovetails
perfectly with the concept of code that runs (and incurs cost) only when there is
work to be done.
Page 2
Optimizing Enterprise Economics with Serverless Architectures
• There are no charges for idle capacity. There is no need (and in fact, no
ability) to pre-provision or over-provision capacity. Instead, billing is
pay-per-request and based on the duration it takes for code to run.
• IoT backends – The ability to bring any code, including native libraries,
simplifies the process of creating cloud-based systems that can
implement device-specific algorithms.
Page 3
Optimizing Enterprise Economics with Serverless Architectures
In addition to the highly adopted use cases discussed earlier, companies are also
applying serverless approaches to the following domains:
Page 4
Optimizing Enterprise Economics with Serverless Architectures
In many cases, simply isolating the business logic of an application is all that’s
required to convert it into a serverless app. Services like AWS Lambda support
popular programming languages and enable the use of custom libraries. Long-
running tasks are expressed as workflows composed of individual functions that
operate within reasonable time frames, which enables the system to restart or
parallelize individual units of computation as required.
Page 5
Optimizing Enterprise Economics with Serverless Architectures
A serverless platform consists of the set of services that comprise the serverless
app, such compute and storage components, as well as the tools needed to
author, build, deploy, and diagnose serverless apps. Running a serverless
application in production requires a reliable, flexible, and trustworthy platform
that can handle the demands of small startups to global, world-wide
corporations. The platform must scale all of an application’s elements and
provide end-to-end reliability. Just as with conventional apps, helping
developers succeed in creating and delivering serverless solutions is a multi-
dimensional challenge. To meet the needs of large-scale enterprises across a
variety of industries, a serverless platform should offer the capabilities in the
following illustration.
Page 6
Optimizing Enterprise Economics with Serverless Architectures
At the core of any serverless platform is the cloud logic layer responsible for
running the functions that represent business logic. Because these functions are
often executed in response to events, simple integration with both first-party
and third-party event sources is essential to making solutions simple to express
and enabling them to scale automatically in response to varying workloads. For
example, serverless functions may need to execute each time an object is created
in an object store or for each update made to a serverless NoSQL database.
Serverless architectures eliminate all of the scaling and management code
typically required to integrate such systems, shifting that operational burden to
the cloud vendor.
Page 7
Optimizing Enterprise Economics with Serverless Architectures
Page 8
Optimizing Enterprise Economics with Serverless Architectures
Finally, the platform must have a broad array of security and access controls,
including support for virtual private networks, role-based and access-based
permissions, robust integration with API-based authentication and access
control mechanisms (including third-party and legacy systems), and support for
encrypting application elements, such as environment variable settings.
Serverless systems, by their design, offer an inherently higher level of security
and control for the following reasons:
Page 9
Optimizing Enterprise Economics with Serverless Architectures
Page 10
Optimizing Enterprise Economics with Serverless Architectures
The AWS serverless compute capabilities provided by Lambda are a key element
of the following managed services offered by AWS, all of which integrate
seamlessly with one another:
Page 11
Optimizing Enterprise Economics with Serverless Architectures
Serverless apps are typically composed of several pieces: one or more functions,
a serverless database such as Amazon DynamoDB, and either an API for clients
to call or an event source that triggers the app. To keep these pieces organized,
AWS uses SAM, the open specification Serverless Application Model. With
SAM, developers can easily describe the functions, APIs, event sources,
database tables, and other parts of a serverless app. Using SAM also helps
developers manage all of the steps in the software development lifecycle, and
AWS offers a range of tools and services to help. This includes native support for
local testing and debugging in their IDE of choice (or via command line) via
Page 12
Optimizing Enterprise Economics with Serverless Architectures
SAM Local, deploying SAM apps using AWS CloudFormation, support for
building SAM apps in AWS CodeBuild, and support for GitHub-based CI/CD for
SAM apps built into AWS CodePipeline. In addition to first-party support, a
number of open source frameworks, CI/CD providers, and performance
management vendors offer support for SAM and Lambda functions, including
Serverless Framework, Claudia, CloudBees, Datadog, and many more. For
additional examples, see Serverless Application Developer Tooling. 4
After a Lambda function (or in the case of a SAM app, potentially several
Lambda functions operating together) has been created, developers can easily
monitor it using automatically created metrics and logs available in Amazon
CloudWatch and CloudWatch Logs. AWS also offers AWS X-Ray, a cross-service
request tracing and performance analysis solution that enables developers to
trace the operation and behavior of individual functions and the events that they
process.
AWS serverless platform offerings have a global reach, with support for AWS
Lambda and Amazon API Gateway in virtually all of the AWS worldwide
Regions. Lambda@Edge is available in all edge locations. 5 Lambda offers a
range of features to help customers improve the reliability of their applications,
including automatic retries for asynchronous and ordered events and dead-
letter queues to capture events that were not processed successfully by the
application. The deep integration with Amazon Virtual Private Cloud (Amazon
VPC) and the flexible range of authentication and access control capabilities
provided by AWS Lambda enable organizations to create secure applications
that adhere to best practices, such as the principle of least privilege. End user
security and management is equally easy – Amazon Cognito offers authorization
and authentication that can be easily combined with Amazon API Gateway and
AWS Lambda, enabling serverless user registration and sign-in capabilities,
including integration with social providers like Facebook and corporate
directories.
Case Studies
Companies have applied serverless architectures to use cases from stock trade
validation to e-commerce website construction to natural language processing.
AWS Lambda and the rest of the AWS serverless portfolio offer the flexibility to
create a wide array of applications, including those requiring assurance
programs such as PCI or HIPAA compliance. The following sections illustrate
Page 13
Optimizing Enterprise Economics with Serverless Architectures
some of the most common use cases, but are not a comprehensive list. For a
complete list of customer references and use case documentation, see Serverless
Computing. 6
• Amazon DynamoDB offers a simple storage solution for session and per-
user state.
• Amazon Cognito provides an easy way to handle end-user registration,
authentication, and access control to resources.
• AWS SAM can be used by developers to describe the various elements of
an application.
• AWS CodeStar can set up a CI/CD toolchain with just a few clicks.
Page 14
Optimizing Enterprise Economics with Serverless Architectures
IoT Backends
The benefits that a serverless architecture brings to web and mobile apps also
makes it easy to construct IoT backends and device-based analytic processing
systems that seamlessly scale with the number of devices. For an example
reference architecture, see Serverless Reference Architecture for creating an IoT
Backend on GitHub. 11
Data Processing
The largest serverless applications process massive volumes of data, much of it
in real time. Typical serverless data processing architectures use a combination
of Amazon Kinesis and AWS Lambda to process streaming data, or they
combine Amazon S3 and AWS Lambda to trigger computation in response to
object creation or update events. When workloads require more complex
orchestration than a simple trigger, developers can use AWS Step Functions to
create stateful or long-running workflows that invoke one or more Lambda
Page 15
Optimizing Enterprise Economics with Serverless Architectures
Page 16
Optimizing Enterprise Economics with Serverless Architectures
Big Data
AWS Lambda is a perfect match for many high-volume, parallel processing
workloads. For an example of a reference architecture using MapReduce, see
Reference architecture for running serverless MapReduce jobs. 20
IT Automation
Serverless approaches eliminate the overhead of managing servers, making
most infrastructure tasks, including provisioning, configuration, management,
alarms/monitors, and timed cron jobs much easier to create and manage.
Page 17
Optimizing Enterprise Economics with Serverless Architectures
Conclusion
Serverless approaches are designed to tackle two classic IT management
problems: idle servers that drain a company’s balance sheet without offering
value, and the cost of building and operating fleets of servers, and server
software, that distract and detract from the business of creating differentiated
customer value. AWS Lambda and the other AWS serverless offerings solve
these longstanding problems by eliminating the servers, containers, disks, and
other infrastructure-level resources from the programming and billing model.
As a result, developers can work with a clean application model that helps them
deliver faster and organizations only pay for useful work. The easiest and fastest
way to architect reactive, event-based systems and to deliver cloud-native
microservices is through the use of serverless architectures. To learn more and
read whitepapers on related topics, see Serverless Computing and
Applications. 25
Contributors
The following individuals and organizations contributed to this document:
Page 18
Optimizing Enterprise Economics with Serverless Architectures
Further Reading
For additional information, see the following:
Reference Architectures
• Web Applications 29
• Mobile Backends 30
• IoT Backends 31
• File Processing 32
• Stream Processing 33
Document Revisions
Date Description
Page 19
Optimizing Enterprise Economics with Serverless Architectures
Notes
1 https://www.forbes.com/sites/moorinsights/2016/04/11/tco-analysis-
demonstrates-how-moving-to-the-cloud-can-save-your-company-money/
http://www.cloudstrategymag.com/articles/86033-understanding-tco-cloud-
economics
2 In 2012, Gartner estimated data center utilization ran from 7 to 12%
(http://www.nytimes.com/2012/09/23/technology/data-centers-waste-vast-
amounts-of-energy-belying-industry-image.html). A 2008 McKinsey study
placed it at 6% (https://www.sallan.org/pdf-
docs/McKinsey_Data_Center_Efficiency.pdf). An Accenture paper analyzing
a set of EC2-based applications found approximately 7% utilization
(http://ieeexplore.ieee.org/document/6118751/). A 2014 study from NRDC
and Anthesis found that, in 2013, over 30% of servers were fully “comatose”
(plugged in, but doing nothing of value) (http://anthesisgroup.com/wp-
content/uploads/2015/06/Case-
Study_DataSupports30PercentComatoseEstimate-FINAL_06032015.pdf).
3 Occupy the Cloud: Eric Jonas et al., Distributed Computing for the 99%,
https://arxiv.org/abs/1702.04024.
4 https://aws.amazon.com/serverless/developer-tools
5 https://aws.amazon.com/lambda/edge/
6 https://aws.amazon.com/serverless/
7 https://d0.awsstatic.com/whitepapers/AWS_Serverless_Multi-
Tier_Architectures.pdf
8 https://github.com/awslabs/lambda-refarch-webapp
9 https://github.com/awslabs/lambda-refarch-mobilebackend
10 https://aws.amazon.com/solutions/case-studies/bustle/
11 https://github.com/awslabs/lambda-refarch-iotbackend
12 https://www.slideshare.net/AmazonWebServices/aws-reinvent-2016-
serverless-iot-back-ends-iot401
13 https://www.youtube.com/watch?v=gKMaf5E-z7Q
14 https://github.com/awslabs/lambda-refarch-streamprocessing
15 https://github.com/awslabs/lambda-refarch-fileprocessing
Page 20
Optimizing Enterprise Economics with Serverless Architectures
16 https://github.com/awslabs/lambda-refarch-imagerecognition
17
https://www.youtube.com/watch?v=AcGv3qUrRC4&feature=youtu.be&t=115
3
18 https://aws.amazon.com/solutions/case-studies/thomson-reuters/
19
https://www.youtube.com/watch?v=VFLKOy4GKXQ&feature=youtu.be&t=1
449
20 https://github.com/awslabs/lambda-refarch-mapreduce
21 https://www.slideshare.net/AmazonWebServices/smc303-realtime-data-
processing-using-aws-lambda/28
22 https://www.slideshare.net/AmazonWebServices/smc301-the-state-of-
serverless-computing-75290821/22
23 https://github.com/alanwill/aws-tailor
24 https://aws.amazon.com/lambda/
25 https://aws.amazon.com/serverless/
26 http://www.allthingsdistributed.com/2016/06/aws-lambda-serverless-
reference-architectures.html
27 https://www.youtube.com/watch?v=AcGv3qUrRC4
28 https://451research.com/report-short?entityId=92764
29 https://github.com/awslabs/lambda-refarch-webapp
30 https://github.com/awslabs/lambda-refarch-mobilebackend
31 https://github.com/awslabs/lambda-refarch-iotbackend
32 https://github.com/awslabs/lambda-refarch-fileprocessing
33 https://github.com/awslabs/lambda-refarch-streamprocessing
34 https://github.com/awslabs/lambda-refarch-imagerecognition
35 https://github.com/awslabs/lambda-refarch-mapreduce
Page 21