Serverless Computing
- 1. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights
reserved.
Introduction To Serverless Computing & Aws
Lambda, Apache OpenWhisk
Rushanth.Namani
(14N61A0568)
Source: Amazon
- 2. What is
serverless?
”Serverless Computing is a cloud execution ,model in Which the cloud provider dynamically
manages the allocation of machine resources. Pricing is based on the actual amount of
resources consumed by an application.”
- 3. Advantages Of Serverless Computing
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
- 4. 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.
- 6. Serverless with AWS Lambda
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights
reserved.
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights
reserved.
- 7. 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.
- 8. 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
- 9. Serverless runs on functions
• Functions are the unit of deployment and scale
• This scales per request!
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights
reserved.
- 11. Using AWS Lambda
Bring your own code
• Node.js, Java, Python,
C#
• Bring your own libraries
(even native ones)
Flexible use
• Synchronous or
asynchronous
• Integrated with other
AWS services
Simple resource model
• Select accesability rating
from 128 MB to 1-.5 GB
• CPU and network
allocated proportionately
Flexible authorization
• Securely grant access to
resources and VPCs
• Fine-grained control for
invoking your functions
- 12. Using AWS Lambda
Authoring functions
• WYSIWYG editor or
upload packaged .zip
• Third-party plugins
(Eclipse, Visual Studio)
Programming model
• Use processes, threads,
/tmp, sockets normally
• AWS SDK built in (Python
and Node.js)
Monitoring and logging
• Metrics for requests,
errors, and throttles
• Built-in logs to Amazon
CloudWatch Logs
Stateless
• Persist data using
external storage
• No affinity or access to
underlying infrastructure
- 13. 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
Amazon
API Gateway
AWS AWS AWS Amazon Amazon SES Amazon SNS Cron
events
Cloudformatio
n
CloudTrail CodeCommit CloudWatch
…and more!
- 14. #1: 3-Tier Web Application
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights
reserved.
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights
reserved.
- 15. 3-Tier web application
Amazon API Dynamic content Data stored in
Gateway in AWS Lambda Amazon DynamoDB
Browser
Amazon
CloudFront
Amazon
S3
Browser
Amazon
CloudFront
Amazon
S3
Amazon API
Gateway
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights
reserved.
Dynamic content in
AWS Lambda
Data store in Amazon
DynamoDB
- 16. 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.
- 17. “Apache OpenWhisk is a serverless, open source cloud platform
that executes functions in response to events without developer
concern for managing the lifecycle or operations of the containers that
execute the code.” (via Apache)
Supported runtimes: Node.js, Python, PHP, Swift and Docker
Deployment: On-premises or in the cloud
Apache OpenWhisk
- 18. Serverless
Supported runtimes: Node.js, Python, PHP, Swift and Docker
Development
Local development via standard tooling and IDEs
Web tooling provided by cloud providers
Orchestration via Composer
- 19. Summary
Use Serverless for ...
Variable and irregular loads (can lead to lower costs)
Developer productivity for first time experience
Inherent auto-scalability
Use AWS for ...
Mature deployment options, e.g. testing, monitoring
Minimal response latency
High performance computing without resource restrictions
- 20. Lambda ?
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.