AWS re:Invent 2016: The State of Serverless Computing (SVR311)

Preview:

Citation preview

© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Dr. Tim Wagner, General Manager, AWS Lambda and Amazon API Gateway

December 1, 2016

Serverless Computing Mini Con

State of the Union

Agenda

What is

serverless?

Build and run applications

without thinking about servers

Let’s take a look at the evolution of computing

Physical servers

in datacenters

Virtual servers

in datacenters

Virtual servers

in the cloud

Each progressive step was better

Physical Servers

Datacenters

Virtual Servers

Datacenters

• Higher utilization

• Faster provisioning speed

• Improved uptime

• Disaster recovery

• Hardware independence

• Trade CAPEX for OPEX

• More scale

• Elastic resources

• Faster speed and agility

• Reduced maintenance

• Better availability and fault

tolerance

Virtual servers

in the cloud

But there are still limitations

Physical Servers

Datacenters

Virtual Servers

Datacenters

• Trade CAPEX for OPEX

• More scale

• Elastic resources

• Faster speed and agility

• Reduced maintenance

• Better availability and fault

tolerance

• Still need to administer

virtual servers

• Still need to manage

capacity and utilization

• Still need to size

workloads

• Still need to manage

availability, fault tolerance

• Still expensive to run

intermittent jobs

Virtual servers

in the cloud

Evolving

to serverlessSERVERLESS

Virtual servers

in the cloud

Physical servers

in datacenters

Virtual servers

in datacenters

No server is easier to manage than no server

All of these responsibilities

go away

Provisioning and utilization

Availability and fault tolerance

Scaling

Operations and management

EVENT DRIVEN CONTINUOUS SCALING PAY BY USAGE

Deliver on demand, never pay for idle

Building blocks for serverless applications

AWS Lambda Amazon DynamoDB

Amazon SNS

Amazon API GatewayAmazon SQS

Amazon Kinesis

Amazon S3

Orchestration and State Management

API Proxy Messaging and Queues Analytics

Monitoring and Debugging

Compute Storage Database

AWS X-RayAWS Step Functions

Serverless changes how you deliver

Speeds up

time to market

Dedicated time

to innovation

Increases developer

productivity

Eliminates operational

complexity

Serverless today

Chatbots

• Powering

chatbot logic

Amazon

Alexa

• Powering

voice-enabled

apps

• Alexa Skills Kit

Common use cases

Web

applications

• Static

websites

• Dynamic

web apps

• Packages for

Flask and

Express

Data

processing

• Real time

• MapReduce

• Batch

Back ends

• Apps &

services

• Mobile

• IoT

</></>

Customers innovating with serverless

Enterprises are achieving massive scale with Lambda

• Thomson Reuters processes 4,000 requests per second

• FINRA processes half a trillion validations of stock trades daily

• Hearst reduced the time to ingest and process data for its

analytics pipeline by 97%

• Vevo can handle spikes of 80x normal traffic

• Expedia triggers 1.2 billion Lambda requests each month

Content services

• Re-architected the platform from the ground up

• Uses microservices architecture

• Can handle spikes of up to 80x normal traffic

Serverless powers Vevo’s critical applications

Data services

• Built its data platform starting from zero

• Serverless architecture: AWS Lambda, Amazon Kinesis, Amazon Redshift, Amazon DynamoDB, Amazon S3, etc.

• New platform went into production in <12 months

Serverless powers Vevo’s critical applications

FINRA

© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Tim Griesbach - Senior Director, FINRA

December 1, 2016

SVR311

How We Perform ½ Trillion Validations Daily

Serverless Computing at FINRA

3

4

It’s more than just ½ Trillion validations…

Volume Varies

Daily & Hourly

• Driven by world events in financial, government, etc.

• Hourly volume varies; max of 75B elements per hour

• Daily volume can vary 2-3x due to market events

Validation

rules expand

over time

• Data must meet a defined specification

• SEC/FINRA adding/reviewing rules regularly

• >200 rules today; >100+ derivations

SLA

Expectations

Don’t Change

• Timely feedback so data can be corrected to meet SLA

• Invalid or late data = $$ fines

5

Traditional on premise solution

• Static Hadoop Cluster, processing files in batches

• Required to be available 24/5

• Map-only job scheduled every 10 minutes

On premise data center

NAS

DB

FTPIncoming

Files

6

Challenges with our on premise solution

• Not easily scalable = sized for peak demand

• Idle 50% of time

• Higher costs

• Required ongoing costly server/software maintenance

• Originally designed for batch processing

7

Goals for our new solution

• Support volume spikes on-demand

• Get out of infrastructure management

• Don’t pay for peak all the time, pay for what we use

• Can we improve the time of availability of data

8

Selecting Technology

Technologies Considered

• AWS Lambda

• Apache Ignite / EC2

• Spark / EMR

Evaluation Process

• Define criteria

• Create POC to validate

Selection Criteria

• Scalability

• Security

• Data Partitioning

• Monitoring

• Performance

• Cost

• Maintenance

9

Our Serverless Cloud Solution

10

Lambda centered AWS Solution

• Validator implemented using

Lambda

• Queues provide input/output

notification from system

• Controller manages data

feeds into Lambda and

notifications out of Lambda

• Data on S3 in Herd

On premise data center

NASFTP

Incoming

Files

Validation

Lambda Account

Controller

Consumer

11

Our Results – Faster, Cheaper, More Scalable

• Reduced cost, only pay for what we use• Reduce by over 50%

• Processing times have been reduced• Goal is regardless of volume, any file avail in <1m

• Errors handled on a finer grained basis

• Horizontal scaling improved

• We have seen volume spikes >3x with no impact

• Less infrastructure to manage

12

FINRA’s Future Plans

• Eliminate the EC2 based controller

• Considering for other ETL processing within FINRA

• Rethink how we can use Lambda for other applications

• Continue push to provide near real-time throughput

17

Thank you!

Serverless is a core component of modern apps

AWS: The Complete Serverless Platform

Capabilities of a

serverless platform

Cloud logic layer

NEW

Cloud logic layer

C#

C# language support

• Powered by .NET Core 1.0 release

• Supports functions packaged as DLLs

• Built in support for NuGet packages

• Author and deploy C# functions using Visual

Studio to AWS Lambda

NEW

Cloud logic layer

Amazon API Gateway

binary encoding• Serve images, audio, video or other binary

data through APIs

• Encode to Base64 or decode to binary

• Automatic encoding to Base64 for AWS

Lambda functions

NEW

Cloud logic layer

Amazon API Gateway

documentation generation• Document your APIs for better developer

experience

• Support for documentation per Swagger

specifications

• Support for separate workflows – tech writer vs API

developer

NEW

Cloud logic layer

Amazon Lex

• Chatbots for Facebook and AWS Mobile Hub

• Powered by the same technology as Alexa

• Efficient and intuitive tools to build

conversations

• Scales automatically

• Connects to enterprise systems

• Slack and Twilio integration coming soon

Responsive data sources

Lambda event sources – AWS services

Amazon API Gateway

Amazon S3

Amazon DynamoDB

Amazon Aurora

Amazon Simple Notification Service

Amazon Simple Email Service

Amazon Cognito

Amazon CloudWatch

Amazon Kinesis Streams

AWS CodeCommit

AWS CloudFormation

AWS Config

Amazon Lex

Integrations library

NEW

Integrations library

Amazon API Gateway listings in

the AWS Marketplace

Reliability and performance

NEW

Reliability and performance

Dead Letter Queues

• Automatically capture events after

exhausting retries

• Build even more reliable event processing

applications

• Target Amazon SQS queues or Amazon

SNS topics

Application modeling framework

Monolithic

application

Microservices

But what happens

when you have an

entire app made up

of many functions?

Composing serverless applications

Meet SAM

AWS Serverless Application Model (SAM)

Standard model for

representing serverless

applications on AWS

Functions, APIs, event

sources, and data stores

Simplifies deployment and

management for serverless

applications

AWS Serverless Application Model (SAM)

• Natively supported by AWS

CloudFormation

• Export any function as a SAM

template

• Package and deploy SAM

templates using AWS CLI

• Open spec under Apache 2.0

for community extensions

Developer ecosystem — AWS

</>

AWS CodePipeline + SAM

GitHub

Amazon S3

AWS CodeCommit

AWS CodeBuild AWS CodeBuild

third-party tools

AWS CloudFormation

Commit Build TestDeploy

to Prod

Developer ecosystem — AWS

How do you debug distributed applications

made of multiple functions or services?

How do you gain insights into how your

functions are performing or behaving?

Introducing AWS X-Ray (in preview)

• Analyze and debug distributed

apps in production

• Visualize service call graph of

your app

• Identify performance

bottlenecks and errors

• Pinpoint service-specific issues

• Identify impact of issues on

users of the app

• Lambda support coming soon

Developer ecosystem

Write

code

Deploy to

customer

Build

and test

Receive

feedback

Developer ecosystem — commercial

MonitoringDeploymentIntegrationsCode libraries APN skills

Developer ecosystem — open source

Chalice

Framework

Orchestration and state management

1. A concept used by

CompSci profs for

torturing undergrads,

full of arcane math

2. A practical way to build

and manage modern

serverless apps

“State machine” (noun)

“I want to sequence functions”

“I want to call functions based on data”

“I want more control over retries”

“I want try/catch/finally”

“I have a workflow that runs for hours”

“I want to run functions in parallel”

Orchestration and state management

Introducing AWS Step Functions

Run cloud state machines

Coordinate components of multi-

step apps

Visualize application as a series of

steps

Handles thousands of workflows

and millions of simultaneous steps

Lambda everywhere

We’ve expanded our

coverage to most

major regions in the

AWS global

infrastructure

Introducing Lambda@Edge (in preview)

Lambda is now available in

all Amazon CloudFront

edge locations

• Low-latency

request/response

customization

• Supporters viewer and

origin events

Introducing AWS Greengrass (in preview)

• Extends AWS processing on devices

• Low latency, near-real time

Serverless is a

fundamental

component of

modern

applications

Conclusion

Lambda is a fundamental

component of modern

application architectures

It has a place in everything

from data processing to

simple web apps

Recommended