SlideShare a Scribd company logo
1 of 51
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS re:INVENT
Getting Started with Serverless
Computing Using AWS Lambda
C h r i s M u n n s – S e r v e r l e s s S e n i o r D e v e l o p e r A d v o c a t e – A W S
N i c k y J o s h i – D i r e c t o r S o f t w a r e E n g i n e e r i n g – C a p i t a l O n e
C L I C K T O A D D T E X T E N T 3 3 2
N o v e m b e r 3 0 , 2 0 1 7
About me
Chris Munns – munns@amazon.com, @chrismunns
• Senior Developer Advocate ─ Serverless
• New Yorker
• Previously:
• AWS Business Development Manager – DevOps, July ‘15–Feb. ‘17
• AWS Solutions Architect Nov. ‘11–Dec. ‘14
• Formerly on operations teams @Etsy and @Meetup
• Little time at a hedge fund, Xerox, and a few other startups
• Rochester Institute of Technology: Applied Networking and Systems
Administration ’05
• Internet infrastructure geek
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
https://secure.flickr.com/photos/mgifford/4525333972
Why are we
here today?
No servers to provision
or manage
Scales with usage
Never pay for idle Availability and fault
tolerance built in
Serverless means…
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
SERVICES (ANYTHING)
Changes in
data state
Requests to
endpoints
Changes in
resource state
EVENT SOURCE FUNCTION
Node.js
Python
Java
C#
Go (coming soon)
Serverless applications
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
CUSTOMERS LOVE SERVERLESS
Common serverless use cases
Web
Applications
• Static
websites
• Complex web
apps
• Packages for
Flask and
Express
Data
Processing
• Real time
• MapReduce
• Batch
Chatbots
• Powering
chatbot logic
Backends
• Apps &
services
• Mobile
• IoT
</></>
Amazon
Alexa
• Powering
voice-enabled
apps
• Alexa Skills
Kit
IT
Automation
• Policy engines
• Extending
AWS services
• Infrastructure
management
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Event-driven compute
Functions as a Service
Serverless FaaS
Using AWS Lambda
Bring your own code
• Node.js, Java, Python,
C#
• Bring your own libraries
(even native ones)
Simple resource model
• Select power rating
from 128 MB to 3 GB
• CPU and network
allocated
proportionately
Flexible use
• Synchronous or
asynchronous
• Integrated with other
AWS services
Flexible authorization
• Securely grant access to
resources and VPCs
• Fine-grained control for
invoking your functions
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Using AWS Lambda
Authoring functions
• WYSIWYG editor or
upload packaged .zip
• Third-party plugins
(Eclipse, Visual Studio)
Monitoring and logging
• Metrics for requests,
errors, and throttles
• Built-in logs to Amazon
CloudWatch Logs
Programming model
• Use processes, threads,
/tmp, sockets normally
• AWS SDK built in
(Python and Node.js)
Stateless
• Persist data using
external storage
• No affinity or access to
underlying infrastructure
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Fine-grained pricing
Buy compute time in 100ms increments
Low request charge
No hourly, daily, or monthly minimums
No per-device fees
Never pay for idle
Free Tier
1M requests and 400,000 GB of compute.
Every month, every customer.
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Lambda execution model
Synchronous (push) Asynchronous (event) Stream-based
Amazon
API Gateway
Lambda
function
Amazon
DynamoDBAmazon
SNS
/order
Lambda
function
Amazon
S3
Reqs
Amazon
Kinesis
Changes
AWS Lambda
service
Function
Amazon S3 Amazon
DynamoDB
Amazon
Kinesis
AWS
CloudFormation
AWS CloudTrail Amazon
CloudWatch
Amazon
Cognito
Amazon SNSAmazon
SES
Cron events
DATA STORES ENDPOINTS
DEVELOPMENT AND MANAGEMENT TOOLS EVENT/MESSAGE SERVICES
Event sources that trigger AWS Lambda
… and more!
AWS
CodeCommit
Amazon
API Gateway
Amazon
Alexa
AWS IoT AWS Step
Functions
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Lambda permissions model
Fine-grained security controls for both
execution and invocation:
Execution policies:
• Define what AWS resources/API calls can this
function access through IAM
• Used in streaming invocations
• E.g. ,“Lambda function A can read from
DynamoDB table users”
Function policies:
• Used for sync and async invocations
• E.g., “Actions on bucket X can invoke Lambda
function Z"
• Resource policies allow for cross-account
access
Amazon API Gateway
Internet
Mobile Apps
Websites
Services
AWS Lambda
functions
AWS
All publicly
accessible
endpoints
Amazon
CloudWatch
monitoring
Amazon
CloudFront
Any other
AWS service
Endpoints on
Amazon EC2
AWS Step
Functions
Create a unified
API front end for
multiple micro-
services
Authenticate and
authorize
requests to a
backend
DDoS protection
and throttling for
your backend
Throttle, meter,
and monetize API
usage by third-
party developers
Amazon API Gateway
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS Step Functions
“Serverless” workflow management with
zero administration:
• Makes it easy to coordinate the
components of distributed applications
and microservices using visual
workflows
• Automatically triggers and tracks each
step, and retries when there are errors,
so your application executes in order
and as expected
• Logs the state of each step, so when
things do go wrong, you can diagnose
and debug problems quickly
Task
Choice
Failure capture
Parallel tasks
Service for building conversational interfaces
into any application using voice and text
Automatic speech recognition (ASR) for
converting speech to text
Natural language understanding (NLU) to
recognize the intent of messages
Powered by the same deep learning
technology as Alexa
Fully managed service
Amazon Lex
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
“Can I go ahead
with the booking?
“Book a Hotel”
“Book a Hotel in
NYC”
Automatic Speech
Recognition
Hotel Booking
New York City
Natural Language
Understanding
Intent/Slot
Model
UtterancesHotel Booking
City New York City
Check in Nov 30th
Check out Dec 2nd
“Your hotel is booked for
Nov 30th”
Amazon Polly
Confirmation: “Your hotel
is booked for Nov 30th”
Book Hotel
NYC
a
in
Amazon
Kinesis
AWS
Lambda 1
Amazon
CloudWatch
Amazon
DynamoDB
AWS
Lambda 2 Amazon
S3
Real-time data processing:
1. Real-time event data sent to Amazon Kinesis,
allows multiple AWS Lambda functions to
process the same events.
2. In AWS Lambda, Function 1 processes and
aggregates data from incoming events, then
stores result data in Amazon DynamoDB
3. Lambda Function 1 also sends values to
Amazon CloudWatch for simple monitoring of
metrics.
4. In AWS Lambda function, Function 2 does data
manipulation of incoming events and stores
results in Amazon S3
https://s3.amazonaws.com/awslambda-reference-architectures/stream-processing/lambda-refarch-streamprocessing.pdf
AWS Lambda + Amazon Kinesis
Serverless distributed computing: PyWren
PyWren Prototype developed at University of California, Berkeley
Uses Python with AWS Lambda stateless functions for large-scale data
analytics
Achieved @ 30-40 MB write and read performance per-core to Amazon S3
object store
Scaled to 60-80 GB across 2,800 simultaneous functions
Build PCI and HIPAA-compliant serverless applications!
Serverless platform services that can be used in both:
AWS
Lambda
Amazon
S3
Amazon
CloudFront
Amazon
DynamoDB
Amazon
Kinesis
Streams
Amazon
Cognito
Amazon API
Gateway
Amazon
SNS
Where do you ..
https://secure.flickr.com/photos/stevendepolo/5749192025/
Frameworks
Chalice
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Claudia.js
Node.js framework for deploying
projects to AWS Lambda and
Amazon API Gateway
• Has sub-projects for
microservices, chatbots, and APIs
• Simplified deployment with a
single command
• Use standard NPM packages, no
need to learn Swagger
• Manage multiple versions
https://claudiajs.com
https://github.com/claudiajs/claudia $ claudia create --region us-east-1 --api-module app
Chalice
Python serverless “microframework”
for AWS Lambda and Amazon API
Gateway
• A command line tool for creating,
deploying, and managing your
app
• A familiar and easy-to-use API for
declaring views in python code
• Automatic Amazon IAM policy
generation
https://github.com/aws/chalice
https://chalice.readthedocs.io $chalice deploy
Chalice
Meet
SAM!
AWS Serverless Application Model (AWS SAM)
Template-driven resource management model
optimized for serverless
New serverless resource types: Functions, APIs,
and tables
Supports anything AWS CloudFormation
supports
Open specification (Apache 2.0)
https://github.com/awslabs/serverless-application-model
SAM template
SAM template
Tells AWS CloudFormation this is a
SAM template it needs to
“transform.”
Creates a Lambda function with the
referenced managed IAM policy,
runtime, code at the referenced .zip
location, and handler as defined.
Also creates an API Gateway and
takes care of all necessary
mapping/permissions.
Creates a DynamoDB table with five
Read & Write units.
SAM template
From: https://github.com/awslabs/aws-serverless-samfarm/blob/master/api/saml.yaml
<-THIS
BECOMES THIS->
Introducing SAM Local
CLI tool for local testing of serverless apps
Works with Lambda functions and “proxy-
style” APIs
Response object and function logs
available on your local machine
Uses open-source docker-lambda images
to mimic Lambda’s execution environment:
• Emulates timeout, memory limits,
runtimes
https://github.com/awslabs/aws-sam-local
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Capital One Auto –
Journey to Serverless
Capital One
• T o p 1 0 U. S. Bank
• A l e xa W e b si te
Ranki ng says
c ap i tal o ne . c o m
tr af f i c i s “ 8 1 st i n
U . S. we b si te s”
• A uto F i nanc i ng – 1 M
hi ts/ m o nth
Migration Journey Timeline
Serverless - I
2015 August
2016
April
2017
Server Based Serverless - II
Migration Requirements
• Full functionality and more
• Secure – yes, we actually are a Financial Institution
• Resilient (Active/Active)
• Responsive – front-facing Marketing Home Page, so initial load time is critical
• SEO friendly
• Continuous deployments – changes on demand
• Low maintenance – it just needs to run
• Use existing tools and processes in the enterprise – don’t re-invent the wheel
• Logging
• Monitoring
• Deployments
The Painful Old Days
• H o s t e d i n o n - p r e m i s e s
d a t a c e n t e r
• E n t e r p r i s e - w i d e
c o m m o n d e p l o y m e n t s
• O n e c a l e n d a r ─
f e a t u r e s p l a n n e d
m o n t h s i n a d v a n c e
• T i g h t c o u p l i n g
b e t w e e n c o m p o n e n t s
Web Browser
Oracle WebLogic Server
J2EE Application Server
Web Container
Servlets
JSPs
EJB Container
Session EJBs
Entity JSPs
JAX-RPC
JDBC JMS
JNDIJMX
JTA
RDBMS
Directory
Service
Message
Queue
Web
Services
Serverless - I
2015 August
2016
April
2017
Server Based Serverless - II
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Serverless Migration – I
Move to AWS
Serverless Content Strategy
App architecture—content
Serverless - I
2015 August
2016
April
2017
Server Based Serverless - II
Amazon
Route 53
Amazon S3
Amazon S3
East Region
West Region
Amazon
CloudFront
Amazon
CloudFront
Amazon
Route 53
Rest APIs
EC2
EC2
EC2
EC2
WAF App
AZ1
AZ2
AZ3
East
EC2
EC2
EC2
EC2
WAF App
AZ1
AZ2
AZ3
West
App Architecture – APIs
Serverless - I
2015 August
2016
April
2017
Server Based Serverless - II
CI/CD for Content
• A p p t e m p l a t e s i n
G i t H u b
• C o n t e n t i n C M S h o s t e d
s e r v i c e
• P r e - r e n d e r a n g u l a r
c o n t e n t ; S E O F r i e n d l y
• U s e A W S C L I t o p u s h
c o n t e n t t o S 3 b u c k e t
f o r w e b h o s t i n g
Content Management
System
AWS CLI
Amazon EC2
Build Server
Content S3 Bucket
Serverless - I
2015 August
2016
April
2017
Server Based Serverless - II
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Serverless Migration - II
Lambda-based APIs
CI/CD Processes
Move to Serverless APIs
Amazon
Route 53
Rest APIs
CapOne
Enterprise
Gateway
Lambda
Fn
Amazon
CloudWatch
Lambda
Fn
East
CapOne
Enterprise
Gateway
Lambda
Fn
Amazon
CloudWatch
Lambda
Fn
West
Serverless - I
2015 August
2016
April
2017
Server Based Serverless - II
CI/CD – Lambda Functions
AWS CLI
Deployment S3 Bucket
Lambda Create
Lambda Update
Lamba Fn
• L a m b d a c o d e i n G i t H u b
• J e n k i n s t r i g g e r e d b u i l d
• U s e s A W S C L I
• D e p l o y i n S 3 b u c k e t
• C r e a t e / u p d a t e
L a m b d a f u n c t i o n
• O t h e r o p t i o n s :
• S A M
• S e r v e r l e s s f r a m e w o r k
Serverless - I
2015 August
2016
April
2017
Server Based Serverless - II
Benefits of Serverless
• Super simple architecture
• Runs itself, less monitoring
• Scales itself, no work on Auto Scaling needed
• No worries on AMI rehydration, which keeps compliance and
operations happy
• Cost savings:
• Conservative savings to tune of $50K/year
• Amazon S3 web hosting eliminated any Amazon EC2 needs for
website hosting
• Able to eliminate 20 EC2 instances, CLBs, EBS volumes from API
architecture
• Countless hours saved on operations of application
Lessons Learned
• Migration can be a journey, so plan accordingly
• Step-by-step progress is recommended
• Start small
• Serverless architectures are flexible and fungible
• No one size fits all
• Reuse tools and processes in the organization
• Get stakeholder buy-in early
Serverless:
• No servers to
manage
• No cost for idle
• Automatic scaling
• High availability
Use cases:
• Web applications
• Backends
• Data processing
• Chatbots
• Amazon Alexa
• IT Automation
Integrated across AWS:
• Amazon API Gateway
• AWS Step Functions
• Amazon S3
• Amazon Kinesis
• Amazon DynamoDB
• Amazon SNS
• Amazon Cognito
• AWS CloudFormation
• AWS CodePipeline
• Amazon CloudWatch
• AWS IoT
• many more!
FIN, ACK
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
aws.amazon.com/serverless
Chris Munns
munns@amazon.com
@chrismunnshttps://www.flickr.com/photos/theredproject/3302110152/
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Thank you!
R e m e m b e r t o r e v i e w t h i s s e s s i o n !
E N T 3 3 2

More Related Content

What's hot

Serverless Architecture - Design Patterns and Best Practices
Serverless Architecture - Design Patterns and Best PracticesServerless Architecture - Design Patterns and Best Practices
Serverless Architecture - Design Patterns and Best PracticesAmazon Web Services
 
Getting Started with AWS Lambda Serverless Computing
Getting Started with AWS Lambda Serverless ComputingGetting Started with AWS Lambda Serverless Computing
Getting Started with AWS Lambda Serverless ComputingAmazon Web Services
 
WIN401_Migrating Microsoft Applications to AWS
WIN401_Migrating Microsoft Applications to AWSWIN401_Migrating Microsoft Applications to AWS
WIN401_Migrating Microsoft Applications to AWSAmazon Web Services
 
Create a Serverless Image Processing Platform
Create a Serverless Image Processing PlatformCreate a Serverless Image Processing Platform
Create a Serverless Image Processing PlatformAmazon Web Services
 
MCL204_How Washington County Sherriff’s Office is using Amazon AI to Identify...
MCL204_How Washington County Sherriff’s Office is using Amazon AI to Identify...MCL204_How Washington County Sherriff’s Office is using Amazon AI to Identify...
MCL204_How Washington County Sherriff’s Office is using Amazon AI to Identify...Amazon Web Services
 
STG301_Deep Dive on Amazon S3 and Glacier Architecture
STG301_Deep Dive on Amazon S3 and Glacier ArchitectureSTG301_Deep Dive on Amazon S3 and Glacier Architecture
STG301_Deep Dive on Amazon S3 and Glacier ArchitectureAmazon Web Services
 
GPSTEC323-SaaS and OpenID Connect The Secret Sauce Multi-Tenant Identity and ...
GPSTEC323-SaaS and OpenID Connect The Secret Sauce Multi-Tenant Identity and ...GPSTEC323-SaaS and OpenID Connect The Secret Sauce Multi-Tenant Identity and ...
GPSTEC323-SaaS and OpenID Connect The Secret Sauce Multi-Tenant Identity and ...Amazon Web Services
 
SRV334-Making Things Right with AWS Config Rules and AWS Lambda
SRV334-Making Things Right with AWS Config Rules and AWS LambdaSRV334-Making Things Right with AWS Config Rules and AWS Lambda
SRV334-Making Things Right with AWS Config Rules and AWS LambdaAmazon Web Services
 
serverless_architecture_patterns_london_loft.pdf
serverless_architecture_patterns_london_loft.pdfserverless_architecture_patterns_london_loft.pdf
serverless_architecture_patterns_london_loft.pdfAmazon Web Services
 
SRV310_Designing Microservices with Serverless
SRV310_Designing Microservices with ServerlessSRV310_Designing Microservices with Serverless
SRV310_Designing Microservices with ServerlessAmazon Web Services
 
Introduction to Serverless computing and AWS Lambda - Floor28
Introduction to Serverless computing and AWS Lambda - Floor28Introduction to Serverless computing and AWS Lambda - Floor28
Introduction to Serverless computing and AWS Lambda - Floor28Boaz Ziniman
 
LFS309-High-Throughput Genomics on AWS.pdf
LFS309-High-Throughput Genomics on AWS.pdfLFS309-High-Throughput Genomics on AWS.pdf
LFS309-High-Throughput Genomics on AWS.pdfAmazon Web Services
 
Getting Started with Amazon EC2 Container Service
Getting Started with Amazon EC2 Container ServiceGetting Started with Amazon EC2 Container Service
Getting Started with Amazon EC2 Container ServiceAmazon Web Services
 
WIN204-Simplifying Microsoft Architectures with AWS Services
WIN204-Simplifying Microsoft Architectures with AWS ServicesWIN204-Simplifying Microsoft Architectures with AWS Services
WIN204-Simplifying Microsoft Architectures with AWS ServicesAmazon Web Services
 
Interstella GTC: Monolith to Microservices with ECS
Interstella GTC: Monolith to Microservices with ECSInterstella GTC: Monolith to Microservices with ECS
Interstella GTC: Monolith to Microservices with ECSAmazon Web Services
 
Deep Dive on Serverless Application Development
Deep Dive on Serverless Application DevelopmentDeep Dive on Serverless Application Development
Deep Dive on Serverless Application DevelopmentAmazon Web Services
 

What's hot (20)

Serverless Architecture - Design Patterns and Best Practices
Serverless Architecture - Design Patterns and Best PracticesServerless Architecture - Design Patterns and Best Practices
Serverless Architecture - Design Patterns and Best Practices
 
Getting Started with AWS Lambda Serverless Computing
Getting Started with AWS Lambda Serverless ComputingGetting Started with AWS Lambda Serverless Computing
Getting Started with AWS Lambda Serverless Computing
 
WIN401_Migrating Microsoft Applications to AWS
WIN401_Migrating Microsoft Applications to AWSWIN401_Migrating Microsoft Applications to AWS
WIN401_Migrating Microsoft Applications to AWS
 
Create a Serverless Image Processing Platform
Create a Serverless Image Processing PlatformCreate a Serverless Image Processing Platform
Create a Serverless Image Processing Platform
 
MCL204_How Washington County Sherriff’s Office is using Amazon AI to Identify...
MCL204_How Washington County Sherriff’s Office is using Amazon AI to Identify...MCL204_How Washington County Sherriff’s Office is using Amazon AI to Identify...
MCL204_How Washington County Sherriff’s Office is using Amazon AI to Identify...
 
STG301_Deep Dive on Amazon S3 and Glacier Architecture
STG301_Deep Dive on Amazon S3 and Glacier ArchitectureSTG301_Deep Dive on Amazon S3 and Glacier Architecture
STG301_Deep Dive on Amazon S3 and Glacier Architecture
 
GPSTEC323-SaaS and OpenID Connect The Secret Sauce Multi-Tenant Identity and ...
GPSTEC323-SaaS and OpenID Connect The Secret Sauce Multi-Tenant Identity and ...GPSTEC323-SaaS and OpenID Connect The Secret Sauce Multi-Tenant Identity and ...
GPSTEC323-SaaS and OpenID Connect The Secret Sauce Multi-Tenant Identity and ...
 
SRV334-Making Things Right with AWS Config Rules and AWS Lambda
SRV334-Making Things Right with AWS Config Rules and AWS LambdaSRV334-Making Things Right with AWS Config Rules and AWS Lambda
SRV334-Making Things Right with AWS Config Rules and AWS Lambda
 
serverless_architecture_patterns_london_loft.pdf
serverless_architecture_patterns_london_loft.pdfserverless_architecture_patterns_london_loft.pdf
serverless_architecture_patterns_london_loft.pdf
 
HLC308_Refactoring to the Cloud
HLC308_Refactoring to the CloudHLC308_Refactoring to the Cloud
HLC308_Refactoring to the Cloud
 
SRV310_Designing Microservices with Serverless
SRV310_Designing Microservices with ServerlessSRV310_Designing Microservices with Serverless
SRV310_Designing Microservices with Serverless
 
Serverless Developer Experience
Serverless Developer ExperienceServerless Developer Experience
Serverless Developer Experience
 
Introduction to Serverless computing and AWS Lambda - Floor28
Introduction to Serverless computing and AWS Lambda - Floor28Introduction to Serverless computing and AWS Lambda - Floor28
Introduction to Serverless computing and AWS Lambda - Floor28
 
Serverless - State Of the Union
Serverless - State Of the UnionServerless - State Of the Union
Serverless - State Of the Union
 
Cost Optimisation on AWS
Cost Optimisation on AWSCost Optimisation on AWS
Cost Optimisation on AWS
 
LFS309-High-Throughput Genomics on AWS.pdf
LFS309-High-Throughput Genomics on AWS.pdfLFS309-High-Throughput Genomics on AWS.pdf
LFS309-High-Throughput Genomics on AWS.pdf
 
Getting Started with Amazon EC2 Container Service
Getting Started with Amazon EC2 Container ServiceGetting Started with Amazon EC2 Container Service
Getting Started with Amazon EC2 Container Service
 
WIN204-Simplifying Microsoft Architectures with AWS Services
WIN204-Simplifying Microsoft Architectures with AWS ServicesWIN204-Simplifying Microsoft Architectures with AWS Services
WIN204-Simplifying Microsoft Architectures with AWS Services
 
Interstella GTC: Monolith to Microservices with ECS
Interstella GTC: Monolith to Microservices with ECSInterstella GTC: Monolith to Microservices with ECS
Interstella GTC: Monolith to Microservices with ECS
 
Deep Dive on Serverless Application Development
Deep Dive on Serverless Application DevelopmentDeep Dive on Serverless Application Development
Deep Dive on Serverless Application Development
 

Similar to Getting Started with Serverless Computing Using AWS Lambda - ENT332 - re:Invent 2017

Building Serverless Microservices with AWS
Building Serverless Microservices with AWSBuilding Serverless Microservices with AWS
Building Serverless Microservices with AWSDonnie Prakoso
 
Serverless Architectural Patterns
Serverless Architectural PatternsServerless Architectural Patterns
Serverless Architectural PatternsAdrian Hornsby
 
Serverless Architectural Patterns 
and Best Practices - Madhu Shekar - AWS
Serverless Architectural Patterns 
and Best Practices - Madhu Shekar - AWSServerless Architectural Patterns 
and Best Practices - Madhu Shekar - AWS
Serverless Architectural Patterns 
and Best Practices - Madhu Shekar - AWSCodeOps Technologies LLP
 
Serverless Architecture Patterns
Serverless Architecture PatternsServerless Architecture Patterns
Serverless Architecture PatternsAmazon Web Services
 
Authoring and Deploying Serverless Applications with AWS SAM
Authoring and Deploying Serverless Applications with AWS SAMAuthoring and Deploying Serverless Applications with AWS SAM
Authoring and Deploying Serverless Applications with AWS SAMAmazon Web Services
 
Getting started with Serverless on AWS
Getting started with Serverless on AWSGetting started with Serverless on AWS
Getting started with Serverless on AWSAdrian Hornsby
 
AWS Application Service Workshop - Serverless Architecture
AWS Application Service Workshop - Serverless ArchitectureAWS Application Service Workshop - Serverless Architecture
AWS Application Service Workshop - Serverless ArchitectureJohn Yeung
 
AWS Innovate Montreal Keynote - by Chris Munns
AWS Innovate Montreal Keynote - by Chris MunnsAWS Innovate Montreal Keynote - by Chris Munns
AWS Innovate Montreal Keynote - by Chris MunnsAmazon Web Services
 
Getting Started with Serverless Architectures
Getting Started with Serverless ArchitecturesGetting Started with Serverless Architectures
Getting Started with Serverless ArchitecturesAmazon Web Services
 
Build and Deploy Serverless Applications with AWS SAM
Build and Deploy Serverless Applications with AWS SAM Build and Deploy Serverless Applications with AWS SAM
Build and Deploy Serverless Applications with AWS SAM Amazon Web Services
 
Serverless in Action on AWS
Serverless in Action on AWSServerless in Action on AWS
Serverless in Action on AWSAdrian Hornsby
 
SRV203 Getting Started with AWS Lambda and the Serverless Cloud
SRV203 Getting Started with AWS Lambda and the Serverless CloudSRV203 Getting Started with AWS Lambda and the Serverless Cloud
SRV203 Getting Started with AWS Lambda and the Serverless CloudAmazon Web Services
 
AWS March 2016 Webinar Series Getting Started with Serverless Architectures
AWS March 2016 Webinar Series   Getting Started with Serverless ArchitecturesAWS March 2016 Webinar Series   Getting Started with Serverless Architectures
AWS March 2016 Webinar Series Getting Started with Serverless ArchitecturesAmazon Web Services
 
Serverless architecture-patterns-and-best-practices
Serverless architecture-patterns-and-best-practicesServerless architecture-patterns-and-best-practices
Serverless architecture-patterns-and-best-practicessaifam
 
How to build and deploy serverless apps - AWS Summit Cape Town 2018
How to build and deploy serverless apps - AWS Summit Cape Town 2018How to build and deploy serverless apps - AWS Summit Cape Town 2018
How to build and deploy serverless apps - AWS Summit Cape Town 2018Amazon Web Services
 
Serverless Development Deep Dive
Serverless Development Deep DiveServerless Development Deep Dive
Serverless Development Deep DiveAmazon Web Services
 
Build and run applications without thinking about servers
Build and run applications without thinking about serversBuild and run applications without thinking about servers
Build and run applications without thinking about serversAmazon Web Services
 
Getting Started with Serverless Architectures - August 2016 Monthly Webinar S...
Getting Started with Serverless Architectures - August 2016 Monthly Webinar S...Getting Started with Serverless Architectures - August 2016 Monthly Webinar S...
Getting Started with Serverless Architectures - August 2016 Monthly Webinar S...Amazon Web Services
 
The Future of Enterprise Applications is Serverless (ENT314-R1) - AWS re:Inve...
The Future of Enterprise Applications is Serverless (ENT314-R1) - AWS re:Inve...The Future of Enterprise Applications is Serverless (ENT314-R1) - AWS re:Inve...
The Future of Enterprise Applications is Serverless (ENT314-R1) - AWS re:Inve...Amazon Web Services
 

Similar to Getting Started with Serverless Computing Using AWS Lambda - ENT332 - re:Invent 2017 (20)

Building Serverless Microservices with AWS
Building Serverless Microservices with AWSBuilding Serverless Microservices with AWS
Building Serverless Microservices with AWS
 
Serverless Architectural Patterns
Serverless Architectural PatternsServerless Architectural Patterns
Serverless Architectural Patterns
 
Serverless Architectural Patterns 
and Best Practices - Madhu Shekar - AWS
Serverless Architectural Patterns 
and Best Practices - Madhu Shekar - AWSServerless Architectural Patterns 
and Best Practices - Madhu Shekar - AWS
Serverless Architectural Patterns 
and Best Practices - Madhu Shekar - AWS
 
Serverless Architecture Patterns
Serverless Architecture PatternsServerless Architecture Patterns
Serverless Architecture Patterns
 
Authoring and Deploying Serverless Applications with AWS SAM
Authoring and Deploying Serverless Applications with AWS SAMAuthoring and Deploying Serverless Applications with AWS SAM
Authoring and Deploying Serverless Applications with AWS SAM
 
Getting started with Serverless on AWS
Getting started with Serverless on AWSGetting started with Serverless on AWS
Getting started with Serverless on AWS
 
AWS Application Service Workshop - Serverless Architecture
AWS Application Service Workshop - Serverless ArchitectureAWS Application Service Workshop - Serverless Architecture
AWS Application Service Workshop - Serverless Architecture
 
AWS Innovate Montreal Keynote - by Chris Munns
AWS Innovate Montreal Keynote - by Chris MunnsAWS Innovate Montreal Keynote - by Chris Munns
AWS Innovate Montreal Keynote - by Chris Munns
 
Getting Started with Serverless Architectures
Getting Started with Serverless ArchitecturesGetting Started with Serverless Architectures
Getting Started with Serverless Architectures
 
Introduction to Serverless
Introduction to ServerlessIntroduction to Serverless
Introduction to Serverless
 
Build and Deploy Serverless Applications with AWS SAM
Build and Deploy Serverless Applications with AWS SAM Build and Deploy Serverless Applications with AWS SAM
Build and Deploy Serverless Applications with AWS SAM
 
Serverless in Action on AWS
Serverless in Action on AWSServerless in Action on AWS
Serverless in Action on AWS
 
SRV203 Getting Started with AWS Lambda and the Serverless Cloud
SRV203 Getting Started with AWS Lambda and the Serverless CloudSRV203 Getting Started with AWS Lambda and the Serverless Cloud
SRV203 Getting Started with AWS Lambda and the Serverless Cloud
 
AWS March 2016 Webinar Series Getting Started with Serverless Architectures
AWS March 2016 Webinar Series   Getting Started with Serverless ArchitecturesAWS March 2016 Webinar Series   Getting Started with Serverless Architectures
AWS March 2016 Webinar Series Getting Started with Serverless Architectures
 
Serverless architecture-patterns-and-best-practices
Serverless architecture-patterns-and-best-practicesServerless architecture-patterns-and-best-practices
Serverless architecture-patterns-and-best-practices
 
How to build and deploy serverless apps - AWS Summit Cape Town 2018
How to build and deploy serverless apps - AWS Summit Cape Town 2018How to build and deploy serverless apps - AWS Summit Cape Town 2018
How to build and deploy serverless apps - AWS Summit Cape Town 2018
 
Serverless Development Deep Dive
Serverless Development Deep DiveServerless Development Deep Dive
Serverless Development Deep Dive
 
Build and run applications without thinking about servers
Build and run applications without thinking about serversBuild and run applications without thinking about servers
Build and run applications without thinking about servers
 
Getting Started with Serverless Architectures - August 2016 Monthly Webinar S...
Getting Started with Serverless Architectures - August 2016 Monthly Webinar S...Getting Started with Serverless Architectures - August 2016 Monthly Webinar S...
Getting Started with Serverless Architectures - August 2016 Monthly Webinar S...
 
The Future of Enterprise Applications is Serverless (ENT314-R1) - AWS re:Inve...
The Future of Enterprise Applications is Serverless (ENT314-R1) - AWS re:Inve...The Future of Enterprise Applications is Serverless (ENT314-R1) - AWS re:Inve...
The Future of Enterprise Applications is Serverless (ENT314-R1) - AWS re:Inve...
 

More from Amazon Web Services

Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...Amazon Web Services
 
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...Amazon Web Services
 
Esegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS FargateEsegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS FargateAmazon Web Services
 
Costruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSCostruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSAmazon Web Services
 
Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot Amazon Web Services
 
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...Amazon Web Services
 
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...Amazon Web Services
 
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows WorkloadsMicrosoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows WorkloadsAmazon Web Services
 
Database Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatareDatabase Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatareAmazon Web Services
 
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJSCrea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJSAmazon Web Services
 
API moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e webAPI moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e webAmazon Web Services
 
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatareDatabase Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatareAmazon Web Services
 
Tools for building your MVP on AWS
Tools for building your MVP on AWSTools for building your MVP on AWS
Tools for building your MVP on AWSAmazon Web Services
 
How to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckHow to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckAmazon Web Services
 
Building a web application without servers
Building a web application without serversBuilding a web application without servers
Building a web application without serversAmazon Web Services
 
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...Amazon Web Services
 
Introduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceIntroduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceAmazon Web Services
 

More from Amazon Web Services (20)

Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
 
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
 
Esegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS FargateEsegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS Fargate
 
Costruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSCostruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWS
 
Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot
 
Open banking as a service
Open banking as a serviceOpen banking as a service
Open banking as a service
 
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
 
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
 
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows WorkloadsMicrosoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
 
Computer Vision con AWS
Computer Vision con AWSComputer Vision con AWS
Computer Vision con AWS
 
Database Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatareDatabase Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatare
 
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJSCrea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
 
API moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e webAPI moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e web
 
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatareDatabase Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
 
Tools for building your MVP on AWS
Tools for building your MVP on AWSTools for building your MVP on AWS
Tools for building your MVP on AWS
 
How to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckHow to Build a Winning Pitch Deck
How to Build a Winning Pitch Deck
 
Building a web application without servers
Building a web application without serversBuilding a web application without servers
Building a web application without servers
 
Fundraising Essentials
Fundraising EssentialsFundraising Essentials
Fundraising Essentials
 
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
 
Introduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceIntroduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container Service
 

Getting Started with Serverless Computing Using AWS Lambda - ENT332 - re:Invent 2017

  • 1. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. AWS re:INVENT Getting Started with Serverless Computing Using AWS Lambda C h r i s M u n n s – S e r v e r l e s s S e n i o r D e v e l o p e r A d v o c a t e – A W S N i c k y J o s h i – D i r e c t o r S o f t w a r e E n g i n e e r i n g – C a p i t a l O n e C L I C K T O A D D T E X T E N T 3 3 2 N o v e m b e r 3 0 , 2 0 1 7
  • 2. About me Chris Munns – munns@amazon.com, @chrismunns • Senior Developer Advocate ─ Serverless • New Yorker • Previously: • AWS Business Development Manager – DevOps, July ‘15–Feb. ‘17 • AWS Solutions Architect Nov. ‘11–Dec. ‘14 • Formerly on operations teams @Etsy and @Meetup • Little time at a hedge fund, Xerox, and a few other startups • Rochester Institute of Technology: Applied Networking and Systems Administration ’05 • Internet infrastructure geek © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
  • 4. No servers to provision or manage Scales with usage Never pay for idle Availability and fault tolerance built in Serverless means… © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
  • 5. SERVICES (ANYTHING) Changes in data state Requests to endpoints Changes in resource state EVENT SOURCE FUNCTION Node.js Python Java C# Go (coming soon) Serverless applications © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
  • 6. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. CUSTOMERS LOVE SERVERLESS
  • 7. Common serverless use cases Web Applications • Static websites • Complex web apps • Packages for Flask and Express Data Processing • Real time • MapReduce • Batch Chatbots • Powering chatbot logic Backends • Apps & services • Mobile • IoT </></> Amazon Alexa • Powering voice-enabled apps • Alexa Skills Kit IT Automation • Policy engines • Extending AWS services • Infrastructure management © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
  • 8. Event-driven compute Functions as a Service Serverless FaaS
  • 9. Using AWS Lambda Bring your own code • Node.js, Java, Python, C# • Bring your own libraries (even native ones) Simple resource model • Select power rating from 128 MB to 3 GB • CPU and network allocated proportionately Flexible use • Synchronous or asynchronous • Integrated with other AWS services Flexible authorization • Securely grant access to resources and VPCs • Fine-grained control for invoking your functions © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
  • 10. Using AWS Lambda Authoring functions • WYSIWYG editor or upload packaged .zip • Third-party plugins (Eclipse, Visual Studio) Monitoring and logging • Metrics for requests, errors, and throttles • Built-in logs to Amazon CloudWatch Logs Programming model • Use processes, threads, /tmp, sockets normally • AWS SDK built in (Python and Node.js) Stateless • Persist data using external storage • No affinity or access to underlying infrastructure © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
  • 11. Fine-grained pricing Buy compute time in 100ms increments Low request charge No hourly, daily, or monthly minimums No per-device fees Never pay for idle Free Tier 1M requests and 400,000 GB of compute. Every month, every customer. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
  • 12. Lambda execution model Synchronous (push) Asynchronous (event) Stream-based Amazon API Gateway Lambda function Amazon DynamoDBAmazon SNS /order Lambda function Amazon S3 Reqs Amazon Kinesis Changes AWS Lambda service Function
  • 13. Amazon S3 Amazon DynamoDB Amazon Kinesis AWS CloudFormation AWS CloudTrail Amazon CloudWatch Amazon Cognito Amazon SNSAmazon SES Cron events DATA STORES ENDPOINTS DEVELOPMENT AND MANAGEMENT TOOLS EVENT/MESSAGE SERVICES Event sources that trigger AWS Lambda … and more! AWS CodeCommit Amazon API Gateway Amazon Alexa AWS IoT AWS Step Functions © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
  • 14. Lambda permissions model Fine-grained security controls for both execution and invocation: Execution policies: • Define what AWS resources/API calls can this function access through IAM • Used in streaming invocations • E.g. ,“Lambda function A can read from DynamoDB table users” Function policies: • Used for sync and async invocations • E.g., “Actions on bucket X can invoke Lambda function Z" • Resource policies allow for cross-account access
  • 15. Amazon API Gateway Internet Mobile Apps Websites Services AWS Lambda functions AWS All publicly accessible endpoints Amazon CloudWatch monitoring Amazon CloudFront Any other AWS service Endpoints on Amazon EC2 AWS Step Functions
  • 16. Create a unified API front end for multiple micro- services Authenticate and authorize requests to a backend DDoS protection and throttling for your backend Throttle, meter, and monetize API usage by third- party developers Amazon API Gateway © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
  • 17. AWS Step Functions “Serverless” workflow management with zero administration: • Makes it easy to coordinate the components of distributed applications and microservices using visual workflows • Automatically triggers and tracks each step, and retries when there are errors, so your application executes in order and as expected • Logs the state of each step, so when things do go wrong, you can diagnose and debug problems quickly Task Choice Failure capture Parallel tasks
  • 18. Service for building conversational interfaces into any application using voice and text Automatic speech recognition (ASR) for converting speech to text Natural language understanding (NLU) to recognize the intent of messages Powered by the same deep learning technology as Alexa Fully managed service Amazon Lex © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
  • 19. “Can I go ahead with the booking? “Book a Hotel” “Book a Hotel in NYC” Automatic Speech Recognition Hotel Booking New York City Natural Language Understanding Intent/Slot Model UtterancesHotel Booking City New York City Check in Nov 30th Check out Dec 2nd “Your hotel is booked for Nov 30th” Amazon Polly Confirmation: “Your hotel is booked for Nov 30th” Book Hotel NYC a in
  • 20. Amazon Kinesis AWS Lambda 1 Amazon CloudWatch Amazon DynamoDB AWS Lambda 2 Amazon S3 Real-time data processing: 1. Real-time event data sent to Amazon Kinesis, allows multiple AWS Lambda functions to process the same events. 2. In AWS Lambda, Function 1 processes and aggregates data from incoming events, then stores result data in Amazon DynamoDB 3. Lambda Function 1 also sends values to Amazon CloudWatch for simple monitoring of metrics. 4. In AWS Lambda function, Function 2 does data manipulation of incoming events and stores results in Amazon S3 https://s3.amazonaws.com/awslambda-reference-architectures/stream-processing/lambda-refarch-streamprocessing.pdf AWS Lambda + Amazon Kinesis
  • 21. Serverless distributed computing: PyWren PyWren Prototype developed at University of California, Berkeley Uses Python with AWS Lambda stateless functions for large-scale data analytics Achieved @ 30-40 MB write and read performance per-core to Amazon S3 object store Scaled to 60-80 GB across 2,800 simultaneous functions
  • 22. Build PCI and HIPAA-compliant serverless applications! Serverless platform services that can be used in both: AWS Lambda Amazon S3 Amazon CloudFront Amazon DynamoDB Amazon Kinesis Streams Amazon Cognito Amazon API Gateway Amazon SNS
  • 23. Where do you .. https://secure.flickr.com/photos/stevendepolo/5749192025/
  • 24. Frameworks Chalice © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
  • 25. Claudia.js Node.js framework for deploying projects to AWS Lambda and Amazon API Gateway • Has sub-projects for microservices, chatbots, and APIs • Simplified deployment with a single command • Use standard NPM packages, no need to learn Swagger • Manage multiple versions https://claudiajs.com https://github.com/claudiajs/claudia $ claudia create --region us-east-1 --api-module app
  • 26. Chalice Python serverless “microframework” for AWS Lambda and Amazon API Gateway • A command line tool for creating, deploying, and managing your app • A familiar and easy-to-use API for declaring views in python code • Automatic Amazon IAM policy generation https://github.com/aws/chalice https://chalice.readthedocs.io $chalice deploy Chalice
  • 28. AWS Serverless Application Model (AWS SAM) Template-driven resource management model optimized for serverless New serverless resource types: Functions, APIs, and tables Supports anything AWS CloudFormation supports Open specification (Apache 2.0) https://github.com/awslabs/serverless-application-model
  • 30. SAM template Tells AWS CloudFormation this is a SAM template it needs to “transform.” Creates a Lambda function with the referenced managed IAM policy, runtime, code at the referenced .zip location, and handler as defined. Also creates an API Gateway and takes care of all necessary mapping/permissions. Creates a DynamoDB table with five Read & Write units.
  • 32. Introducing SAM Local CLI tool for local testing of serverless apps Works with Lambda functions and “proxy- style” APIs Response object and function logs available on your local machine Uses open-source docker-lambda images to mimic Lambda’s execution environment: • Emulates timeout, memory limits, runtimes https://github.com/awslabs/aws-sam-local
  • 33.
  • 34. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Capital One Auto – Journey to Serverless
  • 35. Capital One • T o p 1 0 U. S. Bank • A l e xa W e b si te Ranki ng says c ap i tal o ne . c o m tr af f i c i s “ 8 1 st i n U . S. we b si te s” • A uto F i nanc i ng – 1 M hi ts/ m o nth
  • 36. Migration Journey Timeline Serverless - I 2015 August 2016 April 2017 Server Based Serverless - II
  • 37. Migration Requirements • Full functionality and more • Secure – yes, we actually are a Financial Institution • Resilient (Active/Active) • Responsive – front-facing Marketing Home Page, so initial load time is critical • SEO friendly • Continuous deployments – changes on demand • Low maintenance – it just needs to run • Use existing tools and processes in the enterprise – don’t re-invent the wheel • Logging • Monitoring • Deployments
  • 38. The Painful Old Days • H o s t e d i n o n - p r e m i s e s d a t a c e n t e r • E n t e r p r i s e - w i d e c o m m o n d e p l o y m e n t s • O n e c a l e n d a r ─ f e a t u r e s p l a n n e d m o n t h s i n a d v a n c e • T i g h t c o u p l i n g b e t w e e n c o m p o n e n t s Web Browser Oracle WebLogic Server J2EE Application Server Web Container Servlets JSPs EJB Container Session EJBs Entity JSPs JAX-RPC JDBC JMS JNDIJMX JTA RDBMS Directory Service Message Queue Web Services Serverless - I 2015 August 2016 April 2017 Server Based Serverless - II
  • 39. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Serverless Migration – I Move to AWS Serverless Content Strategy
  • 40. App architecture—content Serverless - I 2015 August 2016 April 2017 Server Based Serverless - II Amazon Route 53 Amazon S3 Amazon S3 East Region West Region Amazon CloudFront Amazon CloudFront
  • 41. Amazon Route 53 Rest APIs EC2 EC2 EC2 EC2 WAF App AZ1 AZ2 AZ3 East EC2 EC2 EC2 EC2 WAF App AZ1 AZ2 AZ3 West App Architecture – APIs Serverless - I 2015 August 2016 April 2017 Server Based Serverless - II
  • 42. CI/CD for Content • A p p t e m p l a t e s i n G i t H u b • C o n t e n t i n C M S h o s t e d s e r v i c e • P r e - r e n d e r a n g u l a r c o n t e n t ; S E O F r i e n d l y • U s e A W S C L I t o p u s h c o n t e n t t o S 3 b u c k e t f o r w e b h o s t i n g Content Management System AWS CLI Amazon EC2 Build Server Content S3 Bucket Serverless - I 2015 August 2016 April 2017 Server Based Serverless - II
  • 43. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Serverless Migration - II Lambda-based APIs CI/CD Processes
  • 44. Move to Serverless APIs Amazon Route 53 Rest APIs CapOne Enterprise Gateway Lambda Fn Amazon CloudWatch Lambda Fn East CapOne Enterprise Gateway Lambda Fn Amazon CloudWatch Lambda Fn West Serverless - I 2015 August 2016 April 2017 Server Based Serverless - II
  • 45. CI/CD – Lambda Functions AWS CLI Deployment S3 Bucket Lambda Create Lambda Update Lamba Fn • L a m b d a c o d e i n G i t H u b • J e n k i n s t r i g g e r e d b u i l d • U s e s A W S C L I • D e p l o y i n S 3 b u c k e t • C r e a t e / u p d a t e L a m b d a f u n c t i o n • O t h e r o p t i o n s : • S A M • S e r v e r l e s s f r a m e w o r k Serverless - I 2015 August 2016 April 2017 Server Based Serverless - II
  • 46. Benefits of Serverless • Super simple architecture • Runs itself, less monitoring • Scales itself, no work on Auto Scaling needed • No worries on AMI rehydration, which keeps compliance and operations happy • Cost savings: • Conservative savings to tune of $50K/year • Amazon S3 web hosting eliminated any Amazon EC2 needs for website hosting • Able to eliminate 20 EC2 instances, CLBs, EBS volumes from API architecture • Countless hours saved on operations of application
  • 47. Lessons Learned • Migration can be a journey, so plan accordingly • Step-by-step progress is recommended • Start small • Serverless architectures are flexible and fungible • No one size fits all • Reuse tools and processes in the organization • Get stakeholder buy-in early
  • 48. Serverless: • No servers to manage • No cost for idle • Automatic scaling • High availability Use cases: • Web applications • Backends • Data processing • Chatbots • Amazon Alexa • IT Automation Integrated across AWS: • Amazon API Gateway • AWS Step Functions • Amazon S3 • Amazon Kinesis • Amazon DynamoDB • Amazon SNS • Amazon Cognito • AWS CloudFormation • AWS CodePipeline • Amazon CloudWatch • AWS IoT • many more! FIN, ACK © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
  • 51. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Thank you! R e m e m b e r t o r e v i e w t h i s s e s s i o n ! E N T 3 3 2