SlideShare a Scribd company logo
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Boaz Ziniman, Technical Evangelist, AWS
@ziniman
Introduction to Serverless computing &
AWS Lambda
Israel AWS User Group - November 2017
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Servers
How will the application
handle server hardware failure?
How can I control
access from my servers?
When should I decide to
scale out my servers?
When should I decide to
scale up my servers?
What size servers are
right for my budget?
How much remaining
capacity do my servers have?
(AAHHHHHHHHH!!)
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
What is
serverless?
Build and run applications
without thinking about servers
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Let’s take a look at the evolution of computing
Physical Servers
Datacenters
Virtual Servers
Datacenters
Virtual Servers
in the cloud
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Each progressive step was better
Physical Servers
Datacenters
Virtual Servers
Datacenters
Virtual Servers
in the cloud
• Higher utilization
• Faster provisioning speed
• Improved uptime
• Disaster recovery
• Hardware independence
• Trade CAPEX for OPEX
• More scale
• Elastic resources
• Faster speed and agility
• Reduced maintenance
• Better availability and
fault tolerance
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
But there are still limitations
Physical Servers
Datacenters
Virtual Servers
Datacenters
• Trade CAPEX for OPEX
• More scale
• Elastic resources
• Faster speed and agility
• Reduced maintenance
• Better availability and
fault tolerance
• Still need to administer
virtual servers
• Still need to manage
capacity and utilization
• Still need to size
workloads
• Still need to manage
availability, fault tolerance
• Still expensive to run
intermittent jobs
Virtual Servers
in the cloud
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Evolving to serverless
SERVERLESS
Virtual servers
in the cloud
Physical servers
in datacenters
Virtual servers
in datacenters
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
No server is easier to manage than any server
All of these responsibilities
go away
Provisioning and utilization
Availability and fault tolerance
Scaling
Operations and management
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Serverless with AWS Lambda
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Deliver on demand, never pay for idle
EVENT DRIVEN CONTINUOUS SCALING PAY BY USAGE
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
What does Serverless mean?
No servers to
provision or manage
Scale with your usage
Built in availability
and fault-tolerance
Never pay for
idle/unused capacity
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Serverless runs on functions
• Functions are the unit of deployment and scale
• This scales per request!
• Skip the boring parts, skip the hard parts
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
How it works?
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
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 1.5 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.
Example event sources
Data stores Endpoints
Configuration repositories Event/message sources
Amazon S3 Amazon
DynamoDB
Amazon
Kinesis
Amazon
Cognito
Amazon IoT AWS Step
Functions
Amazon
Alexa
AWS
CloudTrail
AWS
CodeCommit
Amazon
CloudWatch
Amazon SES Amazon SNS Cron events
Amazon
API Gateway
AWS
Cloudformation
…and more!
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Lambda Use Cases
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
#1: 3-Tier Web Application
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
3-Tier web application
Data stored in
Amazon
DynamoDB
Dynamic content
in AWS Lambda
Amazon API
Gateway
Browser
Amazon
CloudFront
Amazon
S3
Browser
Amazon
CloudFront
Amazon
S3
Amazon API
Gateway
Dynamic content in
AWS Lambda
Data store in Amazon
DynamoDB
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Amazon API
Gateway AWS
Lambda
Amazon
DynamoDB
Amazon
S3
Amazon
CloudFront
• Bucket Policies
• ACLs
• OAI
• Geo-Restriction
• Signed Cookies
• Signed URLs
• DDOS
AuthZ
IAM
Serverless web app security
• Throttling
• Caching
• Usage Plans
Browser
IAM
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Amazon API
Gateway AWS
Lambda
Amazon
DynamoDB
Amazon
S3
Amazon
CloudFront
• Bucket Policies
• ACLs
• OAI
• Geo-Restriction
• Signed Cookies
• Signed URLs
• DDOS
AuthZ
Serverless web app security
• Throttling
• Caching
• Usage Plans
Browser
Amazon
CloudFront
• HTTPS
• Disable Host
Header Forwarding
AWS WAF
IAMIAM
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Amazon API
Gateway
AWS
Lambda
Amazon
DynamoDB
Amazon
S3
Amazon
CloudFront
• Access Logs in S3
Bucket• Access Logs in S3 Bucket
• CloudWatch Metrics-
https://aws.amazon.com/
cloudfront/reporting/
Serverless web app monitoring
AWS WAF
• WebACL Testing
• Total Requests
• Allowed/Blocked
Requests by ACL
logslogs
• Invocations
• Invocation Errors
• Duration
• Throttled
Invocations
• Latency
• Throughput
• Throttled Reqs
• Latency
• Count
• Cache Hit/Miss
• 4XX/5XX Errors
Streams
AWS
CloudTrail
Browser
Custom CloudWatch
Metrics & Alarms
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Serverless web app lifecycle management
• AWS SAM (Serverless Application Model) - blog
AWS
Lambda
Amazon API
Gateway
AWS
CloudFormation
Amazon
S3
Amazon
DynamoDB
Package &
Deploy
Code/Packages/Swagger
Serverless
Template
Serverless
Template
w/ CodeUri
package deploy
CI/CD Tools
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
http://bit.ly/ServerlessShop
https://github.com/patrick-michelberger/serverless-shop
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
#2: automation
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Automation characteristics
• Respond to alarms or events
• Periodic jobs
• Auditing and Notification
• Extend AWS functionality
• Highly Available and scalable
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS Lambda:
Resize Images
Users upload photos
S3:
Source Bucket
S3:
Destination Bucket
Triggered on
PUTs
Automation: image thumbnail creation from S3
https://github.com/awslabs/serverless-image-resizing
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
#3: IoT
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
IoT – Click to Website
MQTT
AWS
IoT
Static S3
Site
Read
SMS
Amazon
CloudFront
Read/
Write
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
MQTT
AWS
IoT
Static S3
Site
Read
SMS
Amazon
CloudFront
Read/
Write
IoT – Click to Website
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
IoT – Click to Website
MQTT
AWS
IoT
Static S3
Site
Read
SMS
Amazon
CloudFront
Read/
Write
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
http://bit.ly/OneClickIoT
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
A few Lambda specific best practices
Lambda is stateless Ă  architect accordingly!
• Assume no affinity with underlying compute infrastructure
• Local filesystem and child processes may not extend beyond
the lifetime of the Lambda request
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Lambda considerations and best practices
• Can your Lambda functions
survive the cold?
• Instantiate AWS clients and
database clients outside the scope
of the handler to take advantage
of connection re-use.
• Schedule with CloudWatch Events
for warmth
• ENIs for VPC support are attached
during cold start
import sys
import logging
import rds_config
import pymysql
rds_host = "rds-instance"
db_name =
rds_config.db_name
try:
conn = pymysql.connect(
except:
logger.error("ERROR:
def handler(event, context):
with conn.cursor() as cur:
Executes during
cold start
Executes with
each invocation
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Lambda considerations and best practices
How about a file system?
• Don’t forget about /tmp
(512 MB of scratch space)
exports.ffmpeg = function(event,context)
{
new ffmpeg('./thumb.MP4', function (err,
video)
{
if (!err) {
video.fnExtractFrameToJPG('/tmp’)
function (error, files) { … }
…
if (!error)
console.log(files);
context.done();
...
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Other resources
• AWS documentation:
http://docs.aws.amazon.com/lambda/latest/dg/welcome.html
• Tons of compute blog posts:
https://aws.amazon.com/blogs/compute/category/aws-lambda/
• Lambda reference architecture:
https://github.com/awslabs/lambda-refarch-webapp
• Hello Retail:
https://github.com/Nordstrom/hello-retail
• Serverless beyond Functions – Serverless using IoT:
https://medium.com/cloud-academy-inc/serverless-beyond-
functions-cd81ee4c6b8d
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Thanks!
Boaz Ziniman, Technical Evangelist, AWS
@ziniman

More Related Content

Similar to Introduction to Serverless Computing and AWS Lambda - AWS IL Meetup (20)

Serverless use cases with AWS Lambda
Serverless use cases with AWS Lambda Serverless use cases with AWS Lambda
Serverless use cases with AWS Lambda
Boaz Ziniman
 
Introducing to serverless computing and AWS lambda - Israel Clouds Meetup
Introducing to serverless computing and AWS lambda - Israel Clouds MeetupIntroducing to serverless computing and AWS lambda - Israel Clouds Meetup
Introducing to serverless computing and AWS lambda - Israel Clouds Meetup
Boaz Ziniman
 
Modern Applications Web Day | Impress Your Friends with Your First Serverless...
Modern Applications Web Day | Impress Your Friends with Your First Serverless...Modern Applications Web Day | Impress Your Friends with Your First Serverless...
Modern Applications Web Day | Impress Your Friends with Your First Serverless...
AWS Germany
 
Serverless Computing
Serverless Computing Serverless Computing
Serverless Computing
Rushi Namani
 
AWS Application Service Workshop - Serverless Architecture
AWS Application Service Workshop - Serverless ArchitectureAWS Application Service Workshop - Serverless Architecture
AWS Application Service Workshop - Serverless Architecture
John Yeung
 
Primeros pasos en desarrollo serverless
Primeros pasos en desarrollo serverlessPrimeros pasos en desarrollo serverless
Primeros pasos en desarrollo serverless
javier ramirez
 
How serverless helps startups innovate and scale
How serverless helps startups innovate and scaleHow serverless helps startups innovate and scale
How serverless helps startups innovate and scale
Gabe Hollombe
 
Modern Applications Development on AWS
Modern Applications Development on AWSModern Applications Development on AWS
Modern Applications Development on AWS
Boaz Ziniman
 
Serverless applications with AWS
Serverless applications with AWSServerless applications with AWS
Serverless applications with AWS
javier ramirez
 
AWSomeDay Zurich 2018 - How to go serverless
AWSomeDay Zurich 2018 - How to go serverless AWSomeDay Zurich 2018 - How to go serverless
AWSomeDay Zurich 2018 - How to go serverless
Roman Plessl
 
Serverless on AWS: Architectural Patterns and Best Practices
Serverless on AWS: Architectural Patterns and Best PracticesServerless on AWS: Architectural Patterns and Best Practices
Serverless on AWS: Architectural Patterns and Best Practices
Vladimir Simek
 
Wildrydes Serverless Workshop Tel Aviv
Wildrydes Serverless Workshop Tel AvivWildrydes Serverless Workshop Tel Aviv
Wildrydes Serverless Workshop Tel Aviv
Boaz Ziniman
 
Aws lambda webinar -buraku
Aws lambda webinar -burakuAws lambda webinar -buraku
Aws lambda webinar -buraku
burakunuvar
 
Getting Started with AWS Lambda and Serverless Computing
Getting Started with AWS Lambda and Serverless ComputingGetting Started with AWS Lambda and Serverless Computing
Getting Started with AWS Lambda and Serverless Computing
Kristana Kane
 
Getting Started with Serverless Architectures
Getting Started with Serverless ArchitecturesGetting Started with Serverless Architectures
Getting Started with Serverless Architectures
Rohini Gaonkar
 
Getting started building your first serverless web application on AWS
Getting started building  your first serverless web application on AWSGetting started building  your first serverless web application on AWS
Getting started building your first serverless web application on AWS
Ioannis Polyzos
 
Getting Started with AWS Lambda & Serverless Cloud
Getting Started with AWS Lambda & Serverless CloudGetting Started with AWS Lambda & Serverless Cloud
Getting Started with AWS Lambda & Serverless Cloud
Ian Massingham
 
Introduction to Serverless
Introduction to ServerlessIntroduction to Serverless
Introduction to Serverless
Steven Bryen
 
From Monolithic to Modern Apps: Best Practices
From Monolithic to Modern Apps: Best PracticesFrom Monolithic to Modern Apps: Best Practices
From Monolithic to Modern Apps: Best Practices
Tom Laszewski
 
Introduction to Serverless Computing - OOP Munich
 Introduction to Serverless Computing - OOP Munich Introduction to Serverless Computing - OOP Munich
Introduction to Serverless Computing - OOP Munich
Boaz Ziniman
 
Serverless use cases with AWS Lambda
Serverless use cases with AWS Lambda Serverless use cases with AWS Lambda
Serverless use cases with AWS Lambda
Boaz Ziniman
 
Introducing to serverless computing and AWS lambda - Israel Clouds Meetup
Introducing to serverless computing and AWS lambda - Israel Clouds MeetupIntroducing to serverless computing and AWS lambda - Israel Clouds Meetup
Introducing to serverless computing and AWS lambda - Israel Clouds Meetup
Boaz Ziniman
 
Modern Applications Web Day | Impress Your Friends with Your First Serverless...
Modern Applications Web Day | Impress Your Friends with Your First Serverless...Modern Applications Web Day | Impress Your Friends with Your First Serverless...
Modern Applications Web Day | Impress Your Friends with Your First Serverless...
AWS Germany
 
Serverless Computing
Serverless Computing Serverless Computing
Serverless Computing
Rushi Namani
 
AWS Application Service Workshop - Serverless Architecture
AWS Application Service Workshop - Serverless ArchitectureAWS Application Service Workshop - Serverless Architecture
AWS Application Service Workshop - Serverless Architecture
John Yeung
 
Primeros pasos en desarrollo serverless
Primeros pasos en desarrollo serverlessPrimeros pasos en desarrollo serverless
Primeros pasos en desarrollo serverless
javier ramirez
 
How serverless helps startups innovate and scale
How serverless helps startups innovate and scaleHow serverless helps startups innovate and scale
How serverless helps startups innovate and scale
Gabe Hollombe
 
Modern Applications Development on AWS
Modern Applications Development on AWSModern Applications Development on AWS
Modern Applications Development on AWS
Boaz Ziniman
 
Serverless applications with AWS
Serverless applications with AWSServerless applications with AWS
Serverless applications with AWS
javier ramirez
 
AWSomeDay Zurich 2018 - How to go serverless
AWSomeDay Zurich 2018 - How to go serverless AWSomeDay Zurich 2018 - How to go serverless
AWSomeDay Zurich 2018 - How to go serverless
Roman Plessl
 
Serverless on AWS: Architectural Patterns and Best Practices
Serverless on AWS: Architectural Patterns and Best PracticesServerless on AWS: Architectural Patterns and Best Practices
Serverless on AWS: Architectural Patterns and Best Practices
Vladimir Simek
 
Wildrydes Serverless Workshop Tel Aviv
Wildrydes Serverless Workshop Tel AvivWildrydes Serverless Workshop Tel Aviv
Wildrydes Serverless Workshop Tel Aviv
Boaz Ziniman
 
Aws lambda webinar -buraku
Aws lambda webinar -burakuAws lambda webinar -buraku
Aws lambda webinar -buraku
burakunuvar
 
Getting Started with AWS Lambda and Serverless Computing
Getting Started with AWS Lambda and Serverless ComputingGetting Started with AWS Lambda and Serverless Computing
Getting Started with AWS Lambda and Serverless Computing
Kristana Kane
 
Getting Started with Serverless Architectures
Getting Started with Serverless ArchitecturesGetting Started with Serverless Architectures
Getting Started with Serverless Architectures
Rohini Gaonkar
 
Getting started building your first serverless web application on AWS
Getting started building  your first serverless web application on AWSGetting started building  your first serverless web application on AWS
Getting started building your first serverless web application on AWS
Ioannis Polyzos
 
Getting Started with AWS Lambda & Serverless Cloud
Getting Started with AWS Lambda & Serverless CloudGetting Started with AWS Lambda & Serverless Cloud
Getting Started with AWS Lambda & Serverless Cloud
Ian Massingham
 
Introduction to Serverless
Introduction to ServerlessIntroduction to Serverless
Introduction to Serverless
Steven Bryen
 
From Monolithic to Modern Apps: Best Practices
From Monolithic to Modern Apps: Best PracticesFrom Monolithic to Modern Apps: Best Practices
From Monolithic to Modern Apps: Best Practices
Tom Laszewski
 
Introduction to Serverless Computing - OOP Munich
 Introduction to Serverless Computing - OOP Munich Introduction to Serverless Computing - OOP Munich
Introduction to Serverless Computing - OOP Munich
Boaz Ziniman
 

More from Boaz Ziniman (20)

AWS Cost Optimization - JLM
AWS Cost Optimization - JLMAWS Cost Optimization - JLM
AWS Cost Optimization - JLM
Boaz Ziniman
 
What can you do with Serverless in 2020
What can you do with Serverless in 2020What can you do with Serverless in 2020
What can you do with Serverless in 2020
Boaz Ziniman
 
Six ways to reduce your AWS bill
Six ways to reduce your AWS billSix ways to reduce your AWS bill
Six ways to reduce your AWS bill
Boaz Ziniman
 
From Cloud to Edge & back again
From Cloud to Edge & back againFrom Cloud to Edge & back again
From Cloud to Edge & back again
Boaz Ziniman
 
Enriching your app with Image recognition and AWS AI services Hebrew Webinar
Enriching your app with Image recognition and AWS AI services Hebrew WebinarEnriching your app with Image recognition and AWS AI services Hebrew Webinar
Enriching your app with Image recognition and AWS AI services Hebrew Webinar
Boaz Ziniman
 
AI Services and Serverless Workshop
AI Services and Serverless WorkshopAI Services and Serverless Workshop
AI Services and Serverless Workshop
Boaz Ziniman
 
Drive Down the Cost of your Data Lake by Using the Right Data Tiering
Drive Down the Cost of your Data Lake by Using the Right Data TieringDrive Down the Cost of your Data Lake by Using the Right Data Tiering
Drive Down the Cost of your Data Lake by Using the Right Data Tiering
Boaz Ziniman
 
Breaking Voice and Language Barriers with AI - Chatbot Summit Tel Aviv
Breaking Voice and Language Barriers with AI - Chatbot Summit Tel AvivBreaking Voice and Language Barriers with AI - Chatbot Summit Tel Aviv
Breaking Voice and Language Barriers with AI - Chatbot Summit Tel Aviv
Boaz Ziniman
 
Serverless Beyond Functions - CTO Club Made in JLM
Serverless Beyond Functions - CTO Club Made in JLMServerless Beyond Functions - CTO Club Made in JLM
Serverless Beyond Functions - CTO Club Made in JLM
Boaz Ziniman
 
Websites Go Serverless - ServerlessDays TLV 2019
Websites Go Serverless - ServerlessDays TLV 2019Websites Go Serverless - ServerlessDays TLV 2019
Websites Go Serverless - ServerlessDays TLV 2019
Boaz Ziniman
 
SKL208 - Turbocharge your Business with AI and Machine Learning - Tel Aviv Su...
SKL208 - Turbocharge your Business with AI and Machine Learning - Tel Aviv Su...SKL208 - Turbocharge your Business with AI and Machine Learning - Tel Aviv Su...
SKL208 - Turbocharge your Business with AI and Machine Learning - Tel Aviv Su...
Boaz Ziniman
 
AIM301 - Breaking Language Barriers With AI - Tel Aviv Summit 2019
AIM301 - Breaking Language Barriers With AI - Tel Aviv Summit 2019AIM301 - Breaking Language Barriers With AI - Tel Aviv Summit 2019
AIM301 - Breaking Language Barriers With AI - Tel Aviv Summit 2019
Boaz Ziniman
 
Breaking Language Barriers with AI - AWS Summit
Breaking Language Barriers with AI - AWS SummitBreaking Language Barriers with AI - AWS Summit
Breaking Language Barriers with AI - AWS Summit
Boaz Ziniman
 
Websites go Serverless - AWS Summit Berlin
Websites go Serverless - AWS Summit BerlinWebsites go Serverless - AWS Summit Berlin
Websites go Serverless - AWS Summit Berlin
Boaz Ziniman
 
AWS Lambda updates from re:Invent
AWS Lambda updates from re:InventAWS Lambda updates from re:Invent
AWS Lambda updates from re:Invent
Boaz Ziniman
 
Artificial Intelligence for Developers - OOP Munich
Artificial Intelligence for Developers - OOP MunichArtificial Intelligence for Developers - OOP Munich
Artificial Intelligence for Developers - OOP Munich
Boaz Ziniman
 
IoT from Cloud to Edge & Back Again - WebSummit 2018
IoT from Cloud to Edge & Back Again - WebSummit 2018IoT from Cloud to Edge & Back Again - WebSummit 2018
IoT from Cloud to Edge & Back Again - WebSummit 2018
Boaz Ziniman
 
Breaking Language Barriers with AI - Web Summit 2018
Breaking Language Barriers with AI - Web Summit 2018Breaking Language Barriers with AI - Web Summit 2018
Breaking Language Barriers with AI - Web Summit 2018
Boaz Ziniman
 
How Websites go Serverless - WebSummit Lisbon 2018
How Websites go Serverless - WebSummit Lisbon 2018How Websites go Serverless - WebSummit Lisbon 2018
How Websites go Serverless - WebSummit Lisbon 2018
Boaz Ziniman
 
AI Services for Developers - Floor28
AI Services for Developers - Floor28AI Services for Developers - Floor28
AI Services for Developers - Floor28
Boaz Ziniman
 
AWS Cost Optimization - JLM
AWS Cost Optimization - JLMAWS Cost Optimization - JLM
AWS Cost Optimization - JLM
Boaz Ziniman
 
What can you do with Serverless in 2020
What can you do with Serverless in 2020What can you do with Serverless in 2020
What can you do with Serverless in 2020
Boaz Ziniman
 
Six ways to reduce your AWS bill
Six ways to reduce your AWS billSix ways to reduce your AWS bill
Six ways to reduce your AWS bill
Boaz Ziniman
 
From Cloud to Edge & back again
From Cloud to Edge & back againFrom Cloud to Edge & back again
From Cloud to Edge & back again
Boaz Ziniman
 
Enriching your app with Image recognition and AWS AI services Hebrew Webinar
Enriching your app with Image recognition and AWS AI services Hebrew WebinarEnriching your app with Image recognition and AWS AI services Hebrew Webinar
Enriching your app with Image recognition and AWS AI services Hebrew Webinar
Boaz Ziniman
 
AI Services and Serverless Workshop
AI Services and Serverless WorkshopAI Services and Serverless Workshop
AI Services and Serverless Workshop
Boaz Ziniman
 
Drive Down the Cost of your Data Lake by Using the Right Data Tiering
Drive Down the Cost of your Data Lake by Using the Right Data TieringDrive Down the Cost of your Data Lake by Using the Right Data Tiering
Drive Down the Cost of your Data Lake by Using the Right Data Tiering
Boaz Ziniman
 
Breaking Voice and Language Barriers with AI - Chatbot Summit Tel Aviv
Breaking Voice and Language Barriers with AI - Chatbot Summit Tel AvivBreaking Voice and Language Barriers with AI - Chatbot Summit Tel Aviv
Breaking Voice and Language Barriers with AI - Chatbot Summit Tel Aviv
Boaz Ziniman
 
Serverless Beyond Functions - CTO Club Made in JLM
Serverless Beyond Functions - CTO Club Made in JLMServerless Beyond Functions - CTO Club Made in JLM
Serverless Beyond Functions - CTO Club Made in JLM
Boaz Ziniman
 
Websites Go Serverless - ServerlessDays TLV 2019
Websites Go Serverless - ServerlessDays TLV 2019Websites Go Serverless - ServerlessDays TLV 2019
Websites Go Serverless - ServerlessDays TLV 2019
Boaz Ziniman
 
SKL208 - Turbocharge your Business with AI and Machine Learning - Tel Aviv Su...
SKL208 - Turbocharge your Business with AI and Machine Learning - Tel Aviv Su...SKL208 - Turbocharge your Business with AI and Machine Learning - Tel Aviv Su...
SKL208 - Turbocharge your Business with AI and Machine Learning - Tel Aviv Su...
Boaz Ziniman
 
AIM301 - Breaking Language Barriers With AI - Tel Aviv Summit 2019
AIM301 - Breaking Language Barriers With AI - Tel Aviv Summit 2019AIM301 - Breaking Language Barriers With AI - Tel Aviv Summit 2019
AIM301 - Breaking Language Barriers With AI - Tel Aviv Summit 2019
Boaz Ziniman
 
Breaking Language Barriers with AI - AWS Summit
Breaking Language Barriers with AI - AWS SummitBreaking Language Barriers with AI - AWS Summit
Breaking Language Barriers with AI - AWS Summit
Boaz Ziniman
 
Websites go Serverless - AWS Summit Berlin
Websites go Serverless - AWS Summit BerlinWebsites go Serverless - AWS Summit Berlin
Websites go Serverless - AWS Summit Berlin
Boaz Ziniman
 
AWS Lambda updates from re:Invent
AWS Lambda updates from re:InventAWS Lambda updates from re:Invent
AWS Lambda updates from re:Invent
Boaz Ziniman
 
Artificial Intelligence for Developers - OOP Munich
Artificial Intelligence for Developers - OOP MunichArtificial Intelligence for Developers - OOP Munich
Artificial Intelligence for Developers - OOP Munich
Boaz Ziniman
 
IoT from Cloud to Edge & Back Again - WebSummit 2018
IoT from Cloud to Edge & Back Again - WebSummit 2018IoT from Cloud to Edge & Back Again - WebSummit 2018
IoT from Cloud to Edge & Back Again - WebSummit 2018
Boaz Ziniman
 
Breaking Language Barriers with AI - Web Summit 2018
Breaking Language Barriers with AI - Web Summit 2018Breaking Language Barriers with AI - Web Summit 2018
Breaking Language Barriers with AI - Web Summit 2018
Boaz Ziniman
 
How Websites go Serverless - WebSummit Lisbon 2018
How Websites go Serverless - WebSummit Lisbon 2018How Websites go Serverless - WebSummit Lisbon 2018
How Websites go Serverless - WebSummit Lisbon 2018
Boaz Ziniman
 
AI Services for Developers - Floor28
AI Services for Developers - Floor28AI Services for Developers - Floor28
AI Services for Developers - Floor28
Boaz Ziniman
 
Ad

Recently uploaded (20)

Let’s Get Slack Certified! 🚀- Slack Community
Let’s Get Slack Certified! 🚀- Slack CommunityLet’s Get Slack Certified! 🚀- Slack Community
Let’s Get Slack Certified! 🚀- Slack Community
SanjeetMishra29
 
LSNIF: Locally-Subdivided Neural Intersection Function
LSNIF: Locally-Subdivided Neural Intersection FunctionLSNIF: Locally-Subdivided Neural Intersection Function
LSNIF: Locally-Subdivided Neural Intersection Function
Takahiro Harada
 
GDG Cloud Southlake #43: Tommy Todd: The Quantum Apocalypse: A Looming Threat...
GDG Cloud Southlake #43: Tommy Todd: The Quantum Apocalypse: A Looming Threat...GDG Cloud Southlake #43: Tommy Todd: The Quantum Apocalypse: A Looming Threat...
GDG Cloud Southlake #43: Tommy Todd: The Quantum Apocalypse: A Looming Threat...
James Anderson
 
Cognitive Chasms - A Typology of GenAI Failure Failure Modes
Cognitive Chasms - A Typology of GenAI Failure Failure ModesCognitive Chasms - A Typology of GenAI Failure Failure Modes
Cognitive Chasms - A Typology of GenAI Failure Failure Modes
Dr. Tathagat Varma
 
Microsoft Build 2025 takeaways in one presentation
Microsoft Build 2025 takeaways in one presentationMicrosoft Build 2025 takeaways in one presentation
Microsoft Build 2025 takeaways in one presentation
Digitalmara
 
Jira Administration Training – Day 1 : Introduction
Jira Administration Training – Day 1 : IntroductionJira Administration Training – Day 1 : Introduction
Jira Administration Training – Day 1 : Introduction
Ravi Teja
 
TrustArc Webinar: Mastering Privacy Contracting
TrustArc Webinar: Mastering Privacy ContractingTrustArc Webinar: Mastering Privacy Contracting
TrustArc Webinar: Mastering Privacy Contracting
TrustArc
 
New Ways to Reduce Database Costs with ScyllaDB
New Ways to Reduce Database Costs with ScyllaDBNew Ways to Reduce Database Costs with ScyllaDB
New Ways to Reduce Database Costs with ScyllaDB
ScyllaDB
 
The case for on-premises AI
The case for on-premises AIThe case for on-premises AI
The case for on-premises AI
Principled Technologies
 
Cybersecurity Fundamentals: Apprentice - Palo Alto Certificate
Cybersecurity Fundamentals: Apprentice - Palo Alto CertificateCybersecurity Fundamentals: Apprentice - Palo Alto Certificate
Cybersecurity Fundamentals: Apprentice - Palo Alto Certificate
VICTOR MAESTRE RAMIREZ
 
6th Power Grid Model Meetup - 21 May 2025
6th Power Grid Model Meetup - 21 May 20256th Power Grid Model Meetup - 21 May 2025
6th Power Grid Model Meetup - 21 May 2025
DanBrown980551
 
Fortinet Certified Associate in Cybersecurity
Fortinet Certified Associate in CybersecurityFortinet Certified Associate in Cybersecurity
Fortinet Certified Associate in Cybersecurity
VICTOR MAESTRE RAMIREZ
 
Gihbli AI and Geo sitution |use/misuse of Ai Technology
Gihbli AI and Geo sitution |use/misuse of Ai TechnologyGihbli AI and Geo sitution |use/misuse of Ai Technology
Gihbli AI and Geo sitution |use/misuse of Ai Technology
zainkhurram1111
 
Agentic AI Explained: The Next Frontier of Autonomous Intelligence & Generati...
Agentic AI Explained: The Next Frontier of Autonomous Intelligence & Generati...Agentic AI Explained: The Next Frontier of Autonomous Intelligence & Generati...
Agentic AI Explained: The Next Frontier of Autonomous Intelligence & Generati...
Aaryan Kansari
 
Jeremy Millul - A Talented Software Developer
Jeremy Millul - A Talented Software DeveloperJeremy Millul - A Talented Software Developer
Jeremy Millul - A Talented Software Developer
Jeremy Millul
 
Dr Jimmy Schwarzkopf presentation on the SUMMIT 2025 A
Dr Jimmy Schwarzkopf presentation on the SUMMIT 2025 ADr Jimmy Schwarzkopf presentation on the SUMMIT 2025 A
Dr Jimmy Schwarzkopf presentation on the SUMMIT 2025 A
Dr. Jimmy Schwarzkopf
 
Grannie’s Journey to Using Healthcare AI Experiences
Grannie’s Journey to Using Healthcare AI ExperiencesGrannie’s Journey to Using Healthcare AI Experiences
Grannie’s Journey to Using Healthcare AI Experiences
Lauren Parr
 
SDG 9000 Series: Unleashing multigigabit everywhere
SDG 9000 Series: Unleashing multigigabit everywhereSDG 9000 Series: Unleashing multigigabit everywhere
SDG 9000 Series: Unleashing multigigabit everywhere
Adtran
 
AI Emotional Actors: “When Machines Learn to Feel and Perform"
AI Emotional Actors:  “When Machines Learn to Feel and Perform"AI Emotional Actors:  “When Machines Learn to Feel and Perform"
AI Emotional Actors: “When Machines Learn to Feel and Perform"
AkashKumar809858
 
European Accessibility Act & Integrated Accessibility Testing
European Accessibility Act & Integrated Accessibility TestingEuropean Accessibility Act & Integrated Accessibility Testing
European Accessibility Act & Integrated Accessibility Testing
Julia Undeutsch
 
Let’s Get Slack Certified! 🚀- Slack Community
Let’s Get Slack Certified! 🚀- Slack CommunityLet’s Get Slack Certified! 🚀- Slack Community
Let’s Get Slack Certified! 🚀- Slack Community
SanjeetMishra29
 
LSNIF: Locally-Subdivided Neural Intersection Function
LSNIF: Locally-Subdivided Neural Intersection FunctionLSNIF: Locally-Subdivided Neural Intersection Function
LSNIF: Locally-Subdivided Neural Intersection Function
Takahiro Harada
 
GDG Cloud Southlake #43: Tommy Todd: The Quantum Apocalypse: A Looming Threat...
GDG Cloud Southlake #43: Tommy Todd: The Quantum Apocalypse: A Looming Threat...GDG Cloud Southlake #43: Tommy Todd: The Quantum Apocalypse: A Looming Threat...
GDG Cloud Southlake #43: Tommy Todd: The Quantum Apocalypse: A Looming Threat...
James Anderson
 
Cognitive Chasms - A Typology of GenAI Failure Failure Modes
Cognitive Chasms - A Typology of GenAI Failure Failure ModesCognitive Chasms - A Typology of GenAI Failure Failure Modes
Cognitive Chasms - A Typology of GenAI Failure Failure Modes
Dr. Tathagat Varma
 
Microsoft Build 2025 takeaways in one presentation
Microsoft Build 2025 takeaways in one presentationMicrosoft Build 2025 takeaways in one presentation
Microsoft Build 2025 takeaways in one presentation
Digitalmara
 
Jira Administration Training – Day 1 : Introduction
Jira Administration Training – Day 1 : IntroductionJira Administration Training – Day 1 : Introduction
Jira Administration Training – Day 1 : Introduction
Ravi Teja
 
TrustArc Webinar: Mastering Privacy Contracting
TrustArc Webinar: Mastering Privacy ContractingTrustArc Webinar: Mastering Privacy Contracting
TrustArc Webinar: Mastering Privacy Contracting
TrustArc
 
New Ways to Reduce Database Costs with ScyllaDB
New Ways to Reduce Database Costs with ScyllaDBNew Ways to Reduce Database Costs with ScyllaDB
New Ways to Reduce Database Costs with ScyllaDB
ScyllaDB
 
Cybersecurity Fundamentals: Apprentice - Palo Alto Certificate
Cybersecurity Fundamentals: Apprentice - Palo Alto CertificateCybersecurity Fundamentals: Apprentice - Palo Alto Certificate
Cybersecurity Fundamentals: Apprentice - Palo Alto Certificate
VICTOR MAESTRE RAMIREZ
 
6th Power Grid Model Meetup - 21 May 2025
6th Power Grid Model Meetup - 21 May 20256th Power Grid Model Meetup - 21 May 2025
6th Power Grid Model Meetup - 21 May 2025
DanBrown980551
 
Fortinet Certified Associate in Cybersecurity
Fortinet Certified Associate in CybersecurityFortinet Certified Associate in Cybersecurity
Fortinet Certified Associate in Cybersecurity
VICTOR MAESTRE RAMIREZ
 
Gihbli AI and Geo sitution |use/misuse of Ai Technology
Gihbli AI and Geo sitution |use/misuse of Ai TechnologyGihbli AI and Geo sitution |use/misuse of Ai Technology
Gihbli AI and Geo sitution |use/misuse of Ai Technology
zainkhurram1111
 
Agentic AI Explained: The Next Frontier of Autonomous Intelligence & Generati...
Agentic AI Explained: The Next Frontier of Autonomous Intelligence & Generati...Agentic AI Explained: The Next Frontier of Autonomous Intelligence & Generati...
Agentic AI Explained: The Next Frontier of Autonomous Intelligence & Generati...
Aaryan Kansari
 
Jeremy Millul - A Talented Software Developer
Jeremy Millul - A Talented Software DeveloperJeremy Millul - A Talented Software Developer
Jeremy Millul - A Talented Software Developer
Jeremy Millul
 
Dr Jimmy Schwarzkopf presentation on the SUMMIT 2025 A
Dr Jimmy Schwarzkopf presentation on the SUMMIT 2025 ADr Jimmy Schwarzkopf presentation on the SUMMIT 2025 A
Dr Jimmy Schwarzkopf presentation on the SUMMIT 2025 A
Dr. Jimmy Schwarzkopf
 
Grannie’s Journey to Using Healthcare AI Experiences
Grannie’s Journey to Using Healthcare AI ExperiencesGrannie’s Journey to Using Healthcare AI Experiences
Grannie’s Journey to Using Healthcare AI Experiences
Lauren Parr
 
SDG 9000 Series: Unleashing multigigabit everywhere
SDG 9000 Series: Unleashing multigigabit everywhereSDG 9000 Series: Unleashing multigigabit everywhere
SDG 9000 Series: Unleashing multigigabit everywhere
Adtran
 
AI Emotional Actors: “When Machines Learn to Feel and Perform"
AI Emotional Actors:  “When Machines Learn to Feel and Perform"AI Emotional Actors:  “When Machines Learn to Feel and Perform"
AI Emotional Actors: “When Machines Learn to Feel and Perform"
AkashKumar809858
 
European Accessibility Act & Integrated Accessibility Testing
European Accessibility Act & Integrated Accessibility TestingEuropean Accessibility Act & Integrated Accessibility Testing
European Accessibility Act & Integrated Accessibility Testing
Julia Undeutsch
 
Ad

Introduction to Serverless Computing and AWS Lambda - AWS IL Meetup

  • 1. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Boaz Ziniman, Technical Evangelist, AWS @ziniman Introduction to Serverless computing & AWS Lambda Israel AWS User Group - November 2017
  • 2. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Servers How will the application handle server hardware failure? How can I control access from my servers? When should I decide to scale out my servers? When should I decide to scale up my servers? What size servers are right for my budget? How much remaining capacity do my servers have? (AAHHHHHHHHH!!)
  • 3. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. What is serverless? Build and run applications without thinking about servers
  • 4. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Let’s take a look at the evolution of computing Physical Servers Datacenters Virtual Servers Datacenters Virtual Servers in the cloud
  • 5. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Each progressive step was better Physical Servers Datacenters Virtual Servers Datacenters Virtual Servers in the cloud • Higher utilization • Faster provisioning speed • Improved uptime • Disaster recovery • Hardware independence • Trade CAPEX for OPEX • More scale • Elastic resources • Faster speed and agility • Reduced maintenance • Better availability and fault tolerance
  • 6. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. But there are still limitations Physical Servers Datacenters Virtual Servers Datacenters • Trade CAPEX for OPEX • More scale • Elastic resources • Faster speed and agility • Reduced maintenance • Better availability and fault tolerance • Still need to administer virtual servers • Still need to manage capacity and utilization • Still need to size workloads • Still need to manage availability, fault tolerance • Still expensive to run intermittent jobs Virtual Servers in the cloud
  • 7. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Evolving to serverless SERVERLESS Virtual servers in the cloud Physical servers in datacenters Virtual servers in datacenters
  • 8. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. No server is easier to manage than any server All of these responsibilities go away Provisioning and utilization Availability and fault tolerance Scaling Operations and management
  • 9. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Serverless with AWS Lambda
  • 10. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Deliver on demand, never pay for idle EVENT DRIVEN CONTINUOUS SCALING PAY BY USAGE
  • 11. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. What does Serverless mean? No servers to provision or manage Scale with your usage Built in availability and fault-tolerance Never pay for idle/unused capacity
  • 12. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
  • 13. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Serverless runs on functions • Functions are the unit of deployment and scale • This scales per request! • Skip the boring parts, skip the hard parts
  • 14. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. How it works?
  • 15. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 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 1.5 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
  • 16. © 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
  • 17. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Example event sources Data stores Endpoints Configuration repositories Event/message sources Amazon S3 Amazon DynamoDB Amazon Kinesis Amazon Cognito Amazon IoT AWS Step Functions Amazon Alexa AWS CloudTrail AWS CodeCommit Amazon CloudWatch Amazon SES Amazon SNS Cron events Amazon API Gateway AWS Cloudformation …and more!
  • 18. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Lambda Use Cases
  • 19. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. #1: 3-Tier Web Application
  • 20. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 3-Tier web application Data stored in Amazon DynamoDB Dynamic content in AWS Lambda Amazon API Gateway Browser Amazon CloudFront Amazon S3 Browser Amazon CloudFront Amazon S3 Amazon API Gateway Dynamic content in AWS Lambda Data store in Amazon DynamoDB
  • 21. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon API Gateway AWS Lambda Amazon DynamoDB Amazon S3 Amazon CloudFront • Bucket Policies • ACLs • OAI • Geo-Restriction • Signed Cookies • Signed URLs • DDOS AuthZ IAM Serverless web app security • Throttling • Caching • Usage Plans Browser IAM
  • 22. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon API Gateway AWS Lambda Amazon DynamoDB Amazon S3 Amazon CloudFront • Bucket Policies • ACLs • OAI • Geo-Restriction • Signed Cookies • Signed URLs • DDOS AuthZ Serverless web app security • Throttling • Caching • Usage Plans Browser Amazon CloudFront • HTTPS • Disable Host Header Forwarding AWS WAF IAMIAM
  • 23. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon API Gateway AWS Lambda Amazon DynamoDB Amazon S3 Amazon CloudFront • Access Logs in S3 Bucket• Access Logs in S3 Bucket • CloudWatch Metrics- https://aws.amazon.com/ cloudfront/reporting/ Serverless web app monitoring AWS WAF • WebACL Testing • Total Requests • Allowed/Blocked Requests by ACL logslogs • Invocations • Invocation Errors • Duration • Throttled Invocations • Latency • Throughput • Throttled Reqs • Latency • Count • Cache Hit/Miss • 4XX/5XX Errors Streams AWS CloudTrail Browser Custom CloudWatch Metrics & Alarms
  • 24. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Serverless web app lifecycle management • AWS SAM (Serverless Application Model) - blog AWS Lambda Amazon API Gateway AWS CloudFormation Amazon S3 Amazon DynamoDB Package & Deploy Code/Packages/Swagger Serverless Template Serverless Template w/ CodeUri package deploy CI/CD Tools
  • 25. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. http://bit.ly/ServerlessShop https://github.com/patrick-michelberger/serverless-shop
  • 26. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. #2: automation
  • 27. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Automation characteristics • Respond to alarms or events • Periodic jobs • Auditing and Notification • Extend AWS functionality • Highly Available and scalable
  • 28. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. AWS Lambda: Resize Images Users upload photos S3: Source Bucket S3: Destination Bucket Triggered on PUTs Automation: image thumbnail creation from S3 https://github.com/awslabs/serverless-image-resizing
  • 29. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. #3: IoT
  • 30. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. IoT – Click to Website MQTT AWS IoT Static S3 Site Read SMS Amazon CloudFront Read/ Write
  • 31. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. MQTT AWS IoT Static S3 Site Read SMS Amazon CloudFront Read/ Write IoT – Click to Website
  • 32. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. IoT – Click to Website MQTT AWS IoT Static S3 Site Read SMS Amazon CloudFront Read/ Write
  • 33. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. http://bit.ly/OneClickIoT
  • 34. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. A few Lambda specific best practices Lambda is stateless Ă  architect accordingly! • Assume no affinity with underlying compute infrastructure • Local filesystem and child processes may not extend beyond the lifetime of the Lambda request
  • 35. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Lambda considerations and best practices • Can your Lambda functions survive the cold? • Instantiate AWS clients and database clients outside the scope of the handler to take advantage of connection re-use. • Schedule with CloudWatch Events for warmth • ENIs for VPC support are attached during cold start import sys import logging import rds_config import pymysql rds_host = "rds-instance" db_name = rds_config.db_name try: conn = pymysql.connect( except: logger.error("ERROR: def handler(event, context): with conn.cursor() as cur: Executes during cold start Executes with each invocation
  • 36. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Lambda considerations and best practices How about a file system? • Don’t forget about /tmp (512 MB of scratch space) exports.ffmpeg = function(event,context) { new ffmpeg('./thumb.MP4', function (err, video) { if (!err) { video.fnExtractFrameToJPG('/tmp’) function (error, files) { … } … if (!error) console.log(files); context.done(); ...
  • 37. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Other resources • AWS documentation: http://docs.aws.amazon.com/lambda/latest/dg/welcome.html • Tons of compute blog posts: https://aws.amazon.com/blogs/compute/category/aws-lambda/ • Lambda reference architecture: https://github.com/awslabs/lambda-refarch-webapp • Hello Retail: https://github.com/Nordstrom/hello-retail • Serverless beyond Functions – Serverless using IoT: https://medium.com/cloud-academy-inc/serverless-beyond- functions-cd81ee4c6b8d
  • 38. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Thanks! Boaz Ziniman, Technical Evangelist, AWS @ziniman