VL 10 Flashcards
FaaS
PaaS
Event driven computer model
Event trigger stateless functions
Short execution time
Payment: per function invocation
Serverless Computing
Application worries don’t have to worry about underlying execution infrastructure, most importantly physical or virtual servers
Serverless computing platform may provide :
FaaS
Backend as a Service
Faas advantages and disadvantages
Advantages:
No provisioning of servers
Automatic scaling
Reduction of costs
Underlying servers shared among different function invocation
Disadvantages
Focused on stateless functions
Performance variation due to restart latencies
Not suited for heavy computation workloads
Limited security: shared VMs, no control over network
Amazon lambda use cases
Image or object upload to Amazon S3
Updates to DynamoDB tables
Responding to website clicks
Backend implementation for custom http requests
Lambda functions
Anonymous functions in functional programming
AWS Lambda Execution model
Synchronous (push): call API
Asynchronous(event)
Stream based
Event sourse that trigger AWS Lambda
Amazon S3, Amazon Alexa, Amazon API Gateway
Public website URL exposed by Amazon S3
{your-bucket-name}.s3-Website.{Region}.amazonaws.com
User management
Amazon Congnito
Permission to write log entries to CloudWatch
Create Indetiry and Access Management (IAM) role for lambda function
OpenWisk
Open source FaaS
Optimization in openWhisk
Warm Containers:
do not delete container’s immediately
Reuse container for subsequent invocation of same function
Pre-warm containers:
Keep a pool of initialized containers with a certain language runtime
OpenWhisk function composition
Small, simple, stateless functions
Approaches:
Client side: client calls the functions
Server side: new function that calls the elementary function and passes the result (double billing problem)
Event driven composition: fist function triggers the next
DRAWBACK: write special code
Or use
Primitive sequence
Primitive sequence adv
• Requires no change or knowledge of the composed functions
• Requires no change to the client code
• Does not inflate costs
• Build into OpenWhisk runtime
Serverless Framework
Cross-platform deployment and management tool
• Support for major FaaS implementation of cloud providers
• Templates for cloud provider and function language
• Command line tool that works for all cloud providers
Specification of application for deployment
• Functions
• Triggers
• Resources
FaaS Providers
Cloud:
Google Cloud functions, IBM Cloud Functions
OperSource:
OpenWhisk, OpenFaaS
When to use Serverless?
• Easily decomposable functions
• Highly-variable demand (fast response time needed)
• No high frequency in triggering
• Overhead of running instances is high (people/mgmt cost)
• Need for tight integration to cloud events
Caution of:
Don’t want to lock in to a cloud
Demand is bit variable