SlideShare una empresa de Scribd logo
1 de 47
Descargar para leer sin conexión
©2015, Amazon Web Services, Inc. or its affiliates. All rights reserved
AWS Lambda:
Event-Driven Code in the Cloud
Dr. Tim Wagner, General Manager AWS Lambda
July 9, 2015 | New York, NY
Apps Without Servers
What’s the easiest server to manage?
The one somebody else takes care of!
Five Sample Use Cases for AWS Lambda
Serverless
Microservices
Adding a
Feature to
Amazon S3
Extending
Platforms
Scalable
Mobile
Backends
Real-Time
Streaming
Analysis
Requirements
• Effortless scaling / no provisioning
• Built-in rollout
• Highly available by default
• BYOC*
• Never pay for idle
*Bring Your Own Code
A Scalable Mobile Backend
A Scalable Mobile Backend…
Without Coding the Mobile Backend
Building a Mobile Backend with AWS Lambda
1. Create an Amazon
DynamoDB database.
2. Pick the “Simple Mobile Backend”
sample code in the Lambda console.
3. Build your app with the AWS Mobile SDK.
AWS Lambda
Let’s see it in action…
Building a Mobile Backend: Add-ons
Want users to log in?
Use Amazon Cognito Identity.
Need device-specific rendering?
Device info is in the function’s context object.
AWS Lambda
What Makes This Easy?
Eliminating the distance between
“Works on my box” and “Ship it to customers!”
Never Pay
for Idle
Built-In
Web Server
Auto Patch
Auto
Deploy
Auto Scale
Built-In
Monitoring
Built-In
Logging
Built-In
Security
HTTP
Endpoint
Diving Deeper: Programming Model
• Two main languages
– Node.js
– Java 8
• Plus Scala, Clojure, and other “jvm” languages
• Run background processes
– Node.js or Java
– Also Python, csh, or your own executable
• Native libraries are welcome!
Serverless Microservices
HTTP Endpoints
Let’s see it in action…
SquirrelBin Architecture
Static web
content served
from
Amazon S3
“Codeless”
Backend +
Acorn
Execution
Acorns Stored
in Amazon
DynamoDB
New Capabilities for AWS Lambda Functions
• Public HTTP endpoints
• Throttling controls
• API Key management
• Results caching
• SDK Generation and Swagger support
• Apache Velocity templates
• API mocking
Learn More About Amazon API Gateway
Build and Manage Your APIs with
Amazon API Gateway
Simon Poile, General Manager
4:30 p.m.–5:30 p.m.
Room 1E12
Diving Deeper: Programming Model
• Run your code sync or async from…
– Any AWS SDK
– AWS Mobile SDK
– REST call
– AWS Command Line Interface
– Inside AWS Lambda itself (yep, it self-hosts)
• Code is pre-credentialed
– Choose a role and Lambda will assume it for you
– Cross account access is supported
Extending Other Platforms
Compute for Connected Devices
• Alexa Skills Kit—build
voice-enabled apps
• Uses AWS Lambda
as a connected
device/IoT platform
Slack Demo Architecture
Alexa, tell Slack to
send, “I’m giving the
demo now.”
Message Retrieval
(via Amazon SQS
queue)
Kevin says,
“Break a leg!”
Message Upload
(via Slack API)
Team
(channel users)
Slack
GitHub Event Responder
Events from
GitHub
Team
(repository users)
GitHub
Amazon SNS
Messages
Ricky Robinett
Developer Evangelist
AWS Lambda Integration Partners
What Makes This Easy?
For the Platform Provider
• Nothing to host
• Nothing to license
• No capacity management
• No web service to run
• Low latency sync calls
• “Fire and forget” events
For the App Developer
• Low cost
• Forever free tier
• No infrastructure
• No “boilerplate” code
• Language choice
• No library restrictions
Diving Deeper: Resource Sizing
• AWS Lambda offers 12 “power levels”
• Higher levels offer more memory and more CPU
power
– 128 MB, lowest CPU power
– 1.5 GB, highest CPU power
• Higher power levels == lower latency for CPU-
bound and bursty tasks
• Compute price scales with the power level
Extending Amazon S3
Extending Amazon S3 with Auto-Compress
Amazon S3 Bucket Events AWS Lambda
Original object Compressed object
1
2
3
How to Add a Feature to Amazon S3
1. Grab Java compress sample from the web.
2. Start with the Amazon S3 event sample:
1. GET original from S3
2. Compress
3. PUT compressed version back to S3
3. Pick some S3 bucket(s) to apply it to.
Let’s see it in action…
What Makes This Easy? Request-Level Scaling!
• Who knows the event
rate? S3 and Lambda!
• You can’t over or under
provision (by design)
• Pay only for what you
use
AWS Services You Can Extend Today
Amazon
S3
Amazon
DynamoDB
AWS
CloudTrail
Amazon
CloudWatch
Logs
AWS
CloudFormation
Amazon
Kinesis
Amazon
Cognito
Amazon
SNS
Amazon CloudWatch Alarm Responder
Amazon
CloudWatch
Alarms
SNS Messages
Real-Time Streaming Analysis
Easy Real-Time Streaming Architecture
Data Ingestion
with Amazon
Kinesis
(PUT record)
Records
retrieved by
AWS Lambda
Your code runs
once per [batch
of] records
Amazon
S3
Amazon
DynamoDB
Smart
Devices
Click
Stream
Log
Data
Amazon
Redshift
Learn more: Watch the Lambda Webinar on Streaming Data
Diving Deeper: Retries and Event Ordering
• Three possibilities:
– Call your AWS Lambda function synchronously.
• Using the AWS SDK? Set your retry logic there.
• Direct RESTful call to Lambda? You control retries entirely.
• Ordering is up to the caller.
– Amazon S3 or SNS trigger your Lambda function, or you call
Lambda asynchronously.
• 3 tries, total, then the event is discarded
• Unordered (“loosely ordered”)
– Lambda polls an Amazon Kinesis or Amazon DynamoDB update
stream for you
• No limit on tries, ordering preserved
Aside: Shards and Ordering
Shard 1
• Record 1a
• Record 1b
Aside: Shards and Ordering
Shard 1
• Record 1a
• Record 1b
Shard 2
• Record 2a
• Record 2b
Shard 3
• Record 3a
• Record 3b
Aside: Shards and Ordering
Shard 1 Shard 2 Shard 3
• Record 3a
• Record 3b
Practicalities
AWS Lambda Regions
AWS Lambda
Region
NEW: Tokyo
launched 6/29
Fine-grained pricing
• Buy compute time in
100 ms increments
• Low request charge
• No hourly, daily, or
monthly minimums
• No per-device fees
Never pay for idle.
Free Tier
1 million requests and 400,000 GBs of compute.
Every month, every customer.
Build and Deploy Integration
Jenkins Grunt
AWS CloudFormation Amazon S3
Partners
Coming Soon: Function Versioning
• How it works:
– Develop at HEAD—updates replace existing code
– Publish to create an immutable snapshot
– Every function has a default version (which can be HEAD)
– Callers can request
• The default version
• A specific version
• HEAD
• APIs support staging and versioning (now)
We’ve Been Busy.
Now, It’s Your Turn.
Go to the AWS Lambda console,
create a function, and run it.
(The first million invokes are on us!)
Congrats, you’re a Lambda
function expert! Add an event
source or an HTTP endpoint.
Build the world’s easiest mobile
backend.
(Hint: Start with the built-in CRUD sample!)
Follow AWS Lambda!
aws.amazon.com/blogs/compute
aws.amazon.com/lambda
AWS Lambda Forum
Your Feedback is Important to AWS
Please complete the session evaluation and tell us what you think.
(I read every comment!)
NEW YORK

Más contenido relacionado

Destacado

AWS電商和零售業解決方案介紹
AWS電商和零售業解決方案介紹AWS電商和零售業解決方案介紹
AWS電商和零售業解決方案介紹Amazon Web Services
 
AWS Webcast - Build Mobile Apps with a Secure, Scalable Back End on DynamoDB
AWS Webcast - Build Mobile Apps with a Secure, Scalable Back End on DynamoDBAWS Webcast - Build Mobile Apps with a Secure, Scalable Back End on DynamoDB
AWS Webcast - Build Mobile Apps with a Secure, Scalable Back End on DynamoDBAmazon Web Services
 
How Parse Built a Mobile Backend as a Service on AWS (MBL307) | AWS re:Invent...
How Parse Built a Mobile Backend as a Service on AWS (MBL307) | AWS re:Invent...How Parse Built a Mobile Backend as a Service on AWS (MBL307) | AWS re:Invent...
How Parse Built a Mobile Backend as a Service on AWS (MBL307) | AWS re:Invent...Amazon Web Services
 
01 chapter01 process_flow_diagram
01 chapter01 process_flow_diagram01 chapter01 process_flow_diagram
01 chapter01 process_flow_diagramJohn Todora
 
Netflix: Amazon S3 & Amazon Elastic MapReduce to Monitor at Gigascale (BDT302...
Netflix: Amazon S3 & Amazon Elastic MapReduce to Monitor at Gigascale (BDT302...Netflix: Amazon S3 & Amazon Elastic MapReduce to Monitor at Gigascale (BDT302...
Netflix: Amazon S3 & Amazon Elastic MapReduce to Monitor at Gigascale (BDT302...Amazon Web Services
 
Process Flow Chart, Etihad Sugar Mills Limted, RYK
Process Flow Chart, Etihad Sugar Mills Limted, RYKProcess Flow Chart, Etihad Sugar Mills Limted, RYK
Process Flow Chart, Etihad Sugar Mills Limted, RYKMuhammad Usman Habib
 
Using AWS CloudFront with S3 at SMARTSTUDY
Using AWS CloudFront with S3 at SMARTSTUDYUsing AWS CloudFront with S3 at SMARTSTUDY
Using AWS CloudFront with S3 at SMARTSTUDYHyun-woo Park
 
Architecting for Scale using Microservices & Serverless Backends
Architecting for Scale using Microservices & Serverless BackendsArchitecting for Scale using Microservices & Serverless Backends
Architecting for Scale using Microservices & Serverless BackendsAmazon Web Services
 
Becoming a Command Line Expert with the AWS CLI (TLS304) | AWS re:Invent 2013
Becoming a Command Line Expert with the AWS CLI (TLS304) | AWS re:Invent 2013Becoming a Command Line Expert with the AWS CLI (TLS304) | AWS re:Invent 2013
Becoming a Command Line Expert with the AWS CLI (TLS304) | AWS re:Invent 2013Amazon Web Services
 
東南アジアにおけるEC市場の概況と消費動向(2015年)
東南アジアにおけるEC市場の概況と消費動向(2015年)東南アジアにおけるEC市場の概況と消費動向(2015年)
東南アジアにおけるEC市場の概況と消費動向(2015年)Yuriko Kai
 
AWS Re:Invent - Optimizing Costs with AWS
AWS Re:Invent -  Optimizing Costs with AWSAWS Re:Invent -  Optimizing Costs with AWS
AWS Re:Invent - Optimizing Costs with AWSCoburn Watson
 
(DEV301) Advanced Usage of the AWS CLI | AWS re:Invent 2014
(DEV301) Advanced Usage of the AWS CLI | AWS re:Invent 2014(DEV301) Advanced Usage of the AWS CLI | AWS re:Invent 2014
(DEV301) Advanced Usage of the AWS CLI | AWS re:Invent 2014Amazon Web Services
 
Zalora IR Deck - May 2014
Zalora IR Deck - May 2014Zalora IR Deck - May 2014
Zalora IR Deck - May 2014SYGroup
 
MED202 Netflix’s Transcoding Transformation - AWS re: Invent 2012
MED202 Netflix’s Transcoding Transformation - AWS re: Invent 2012MED202 Netflix’s Transcoding Transformation - AWS re: Invent 2012
MED202 Netflix’s Transcoding Transformation - AWS re: Invent 2012Amazon Web Services
 
RMG202 Rainmakers: How Netflix Operates Clouds for Maximum Freedom and Agilit...
RMG202 Rainmakers: How Netflix Operates Clouds for Maximum Freedom and Agilit...RMG202 Rainmakers: How Netflix Operates Clouds for Maximum Freedom and Agilit...
RMG202 Rainmakers: How Netflix Operates Clouds for Maximum Freedom and Agilit...Amazon Web Services
 

Destacado (16)

AWS電商和零售業解決方案介紹
AWS電商和零售業解決方案介紹AWS電商和零售業解決方案介紹
AWS電商和零售業解決方案介紹
 
AWS Webcast - Build Mobile Apps with a Secure, Scalable Back End on DynamoDB
AWS Webcast - Build Mobile Apps with a Secure, Scalable Back End on DynamoDBAWS Webcast - Build Mobile Apps with a Secure, Scalable Back End on DynamoDB
AWS Webcast - Build Mobile Apps with a Secure, Scalable Back End on DynamoDB
 
How Parse Built a Mobile Backend as a Service on AWS (MBL307) | AWS re:Invent...
How Parse Built a Mobile Backend as a Service on AWS (MBL307) | AWS re:Invent...How Parse Built a Mobile Backend as a Service on AWS (MBL307) | AWS re:Invent...
How Parse Built a Mobile Backend as a Service on AWS (MBL307) | AWS re:Invent...
 
Resume - Rodennel Alcantara
Resume - Rodennel AlcantaraResume - Rodennel Alcantara
Resume - Rodennel Alcantara
 
01 chapter01 process_flow_diagram
01 chapter01 process_flow_diagram01 chapter01 process_flow_diagram
01 chapter01 process_flow_diagram
 
Netflix: Amazon S3 & Amazon Elastic MapReduce to Monitor at Gigascale (BDT302...
Netflix: Amazon S3 & Amazon Elastic MapReduce to Monitor at Gigascale (BDT302...Netflix: Amazon S3 & Amazon Elastic MapReduce to Monitor at Gigascale (BDT302...
Netflix: Amazon S3 & Amazon Elastic MapReduce to Monitor at Gigascale (BDT302...
 
Process Flow Chart, Etihad Sugar Mills Limted, RYK
Process Flow Chart, Etihad Sugar Mills Limted, RYKProcess Flow Chart, Etihad Sugar Mills Limted, RYK
Process Flow Chart, Etihad Sugar Mills Limted, RYK
 
Using AWS CloudFront with S3 at SMARTSTUDY
Using AWS CloudFront with S3 at SMARTSTUDYUsing AWS CloudFront with S3 at SMARTSTUDY
Using AWS CloudFront with S3 at SMARTSTUDY
 
Architecting for Scale using Microservices & Serverless Backends
Architecting for Scale using Microservices & Serverless BackendsArchitecting for Scale using Microservices & Serverless Backends
Architecting for Scale using Microservices & Serverless Backends
 
Becoming a Command Line Expert with the AWS CLI (TLS304) | AWS re:Invent 2013
Becoming a Command Line Expert with the AWS CLI (TLS304) | AWS re:Invent 2013Becoming a Command Line Expert with the AWS CLI (TLS304) | AWS re:Invent 2013
Becoming a Command Line Expert with the AWS CLI (TLS304) | AWS re:Invent 2013
 
東南アジアにおけるEC市場の概況と消費動向(2015年)
東南アジアにおけるEC市場の概況と消費動向(2015年)東南アジアにおけるEC市場の概況と消費動向(2015年)
東南アジアにおけるEC市場の概況と消費動向(2015年)
 
AWS Re:Invent - Optimizing Costs with AWS
AWS Re:Invent -  Optimizing Costs with AWSAWS Re:Invent -  Optimizing Costs with AWS
AWS Re:Invent - Optimizing Costs with AWS
 
(DEV301) Advanced Usage of the AWS CLI | AWS re:Invent 2014
(DEV301) Advanced Usage of the AWS CLI | AWS re:Invent 2014(DEV301) Advanced Usage of the AWS CLI | AWS re:Invent 2014
(DEV301) Advanced Usage of the AWS CLI | AWS re:Invent 2014
 
Zalora IR Deck - May 2014
Zalora IR Deck - May 2014Zalora IR Deck - May 2014
Zalora IR Deck - May 2014
 
MED202 Netflix’s Transcoding Transformation - AWS re: Invent 2012
MED202 Netflix’s Transcoding Transformation - AWS re: Invent 2012MED202 Netflix’s Transcoding Transformation - AWS re: Invent 2012
MED202 Netflix’s Transcoding Transformation - AWS re: Invent 2012
 
RMG202 Rainmakers: How Netflix Operates Clouds for Maximum Freedom and Agilit...
RMG202 Rainmakers: How Netflix Operates Clouds for Maximum Freedom and Agilit...RMG202 Rainmakers: How Netflix Operates Clouds for Maximum Freedom and Agilit...
RMG202 Rainmakers: How Netflix Operates Clouds for Maximum Freedom and Agilit...
 

Más de 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
 

Más de 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
 

Último

A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 

Último (20)

A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 

AWS Lambda: Event-driven Code in the Cloud

  • 1. ©2015, Amazon Web Services, Inc. or its affiliates. All rights reserved AWS Lambda: Event-Driven Code in the Cloud Dr. Tim Wagner, General Manager AWS Lambda July 9, 2015 | New York, NY
  • 2. Apps Without Servers What’s the easiest server to manage? The one somebody else takes care of!
  • 3. Five Sample Use Cases for AWS Lambda Serverless Microservices Adding a Feature to Amazon S3 Extending Platforms Scalable Mobile Backends Real-Time Streaming Analysis
  • 4. Requirements • Effortless scaling / no provisioning • Built-in rollout • Highly available by default • BYOC* • Never pay for idle *Bring Your Own Code
  • 6. A Scalable Mobile Backend… Without Coding the Mobile Backend
  • 7. Building a Mobile Backend with AWS Lambda 1. Create an Amazon DynamoDB database. 2. Pick the “Simple Mobile Backend” sample code in the Lambda console. 3. Build your app with the AWS Mobile SDK. AWS Lambda Let’s see it in action…
  • 8. Building a Mobile Backend: Add-ons Want users to log in? Use Amazon Cognito Identity. Need device-specific rendering? Device info is in the function’s context object. AWS Lambda
  • 9. What Makes This Easy? Eliminating the distance between “Works on my box” and “Ship it to customers!” Never Pay for Idle Built-In Web Server Auto Patch Auto Deploy Auto Scale Built-In Monitoring Built-In Logging Built-In Security HTTP Endpoint
  • 10. Diving Deeper: Programming Model • Two main languages – Node.js – Java 8 • Plus Scala, Clojure, and other “jvm” languages • Run background processes – Node.js or Java – Also Python, csh, or your own executable • Native libraries are welcome!
  • 12. HTTP Endpoints Let’s see it in action…
  • 13. SquirrelBin Architecture Static web content served from Amazon S3 “Codeless” Backend + Acorn Execution Acorns Stored in Amazon DynamoDB
  • 14. New Capabilities for AWS Lambda Functions • Public HTTP endpoints • Throttling controls • API Key management • Results caching • SDK Generation and Swagger support • Apache Velocity templates • API mocking
  • 15. Learn More About Amazon API Gateway Build and Manage Your APIs with Amazon API Gateway Simon Poile, General Manager 4:30 p.m.–5:30 p.m. Room 1E12
  • 16. Diving Deeper: Programming Model • Run your code sync or async from… – Any AWS SDK – AWS Mobile SDK – REST call – AWS Command Line Interface – Inside AWS Lambda itself (yep, it self-hosts) • Code is pre-credentialed – Choose a role and Lambda will assume it for you – Cross account access is supported
  • 18. Compute for Connected Devices • Alexa Skills Kit—build voice-enabled apps • Uses AWS Lambda as a connected device/IoT platform
  • 19. Slack Demo Architecture Alexa, tell Slack to send, “I’m giving the demo now.” Message Retrieval (via Amazon SQS queue) Kevin says, “Break a leg!” Message Upload (via Slack API) Team (channel users) Slack
  • 20. GitHub Event Responder Events from GitHub Team (repository users) GitHub Amazon SNS Messages
  • 23. What Makes This Easy? For the Platform Provider • Nothing to host • Nothing to license • No capacity management • No web service to run • Low latency sync calls • “Fire and forget” events For the App Developer • Low cost • Forever free tier • No infrastructure • No “boilerplate” code • Language choice • No library restrictions
  • 24. Diving Deeper: Resource Sizing • AWS Lambda offers 12 “power levels” • Higher levels offer more memory and more CPU power – 128 MB, lowest CPU power – 1.5 GB, highest CPU power • Higher power levels == lower latency for CPU- bound and bursty tasks • Compute price scales with the power level
  • 26. Extending Amazon S3 with Auto-Compress Amazon S3 Bucket Events AWS Lambda Original object Compressed object 1 2 3
  • 27. How to Add a Feature to Amazon S3 1. Grab Java compress sample from the web. 2. Start with the Amazon S3 event sample: 1. GET original from S3 2. Compress 3. PUT compressed version back to S3 3. Pick some S3 bucket(s) to apply it to. Let’s see it in action…
  • 28. What Makes This Easy? Request-Level Scaling! • Who knows the event rate? S3 and Lambda! • You can’t over or under provision (by design) • Pay only for what you use
  • 29. AWS Services You Can Extend Today Amazon S3 Amazon DynamoDB AWS CloudTrail Amazon CloudWatch Logs AWS CloudFormation Amazon Kinesis Amazon Cognito Amazon SNS
  • 30. Amazon CloudWatch Alarm Responder Amazon CloudWatch Alarms SNS Messages
  • 32. Easy Real-Time Streaming Architecture Data Ingestion with Amazon Kinesis (PUT record) Records retrieved by AWS Lambda Your code runs once per [batch of] records Amazon S3 Amazon DynamoDB Smart Devices Click Stream Log Data Amazon Redshift Learn more: Watch the Lambda Webinar on Streaming Data
  • 33. Diving Deeper: Retries and Event Ordering • Three possibilities: – Call your AWS Lambda function synchronously. • Using the AWS SDK? Set your retry logic there. • Direct RESTful call to Lambda? You control retries entirely. • Ordering is up to the caller. – Amazon S3 or SNS trigger your Lambda function, or you call Lambda asynchronously. • 3 tries, total, then the event is discarded • Unordered (“loosely ordered”) – Lambda polls an Amazon Kinesis or Amazon DynamoDB update stream for you • No limit on tries, ordering preserved
  • 34. Aside: Shards and Ordering Shard 1 • Record 1a • Record 1b
  • 35. Aside: Shards and Ordering Shard 1 • Record 1a • Record 1b Shard 2 • Record 2a • Record 2b Shard 3 • Record 3a • Record 3b
  • 36. Aside: Shards and Ordering Shard 1 Shard 2 Shard 3 • Record 3a • Record 3b
  • 38. AWS Lambda Regions AWS Lambda Region NEW: Tokyo launched 6/29
  • 39. Fine-grained pricing • Buy compute time in 100 ms increments • Low request charge • No hourly, daily, or monthly minimums • No per-device fees Never pay for idle. Free Tier 1 million requests and 400,000 GBs of compute. Every month, every customer.
  • 40. Build and Deploy Integration Jenkins Grunt AWS CloudFormation Amazon S3 Partners
  • 41. Coming Soon: Function Versioning • How it works: – Develop at HEAD—updates replace existing code – Publish to create an immutable snapshot – Every function has a default version (which can be HEAD) – Callers can request • The default version • A specific version • HEAD • APIs support staging and versioning (now)
  • 42. We’ve Been Busy. Now, It’s Your Turn.
  • 43. Go to the AWS Lambda console, create a function, and run it. (The first million invokes are on us!)
  • 44. Congrats, you’re a Lambda function expert! Add an event source or an HTTP endpoint.
  • 45. Build the world’s easiest mobile backend. (Hint: Start with the built-in CRUD sample!)
  • 46. Follow AWS Lambda! aws.amazon.com/blogs/compute aws.amazon.com/lambda AWS Lambda Forum Your Feedback is Important to AWS Please complete the session evaluation and tell us what you think. (I read every comment!)