L10 - FaaS Flashcards
(36 cards)
severless meaing
application owners do not have to worry about the underlying execution infrastructure, mostl importantly physical or virtual servers.
What is often used as a synonym for FaaS?
Serverless computing
A serverless computing platform may provide one or both of the following
- Function-as-a-Service (FaaS)
- Backend-as-a-Service (Baas)
What is FaaS?
Function-as-a-Service
Typically provides event-driven computing. Developers run and manage application code with functions that are triggered by events or HTTP requests. Developers deploy small units of code the FaaS, which are executed as needed as discrete actions, scaling without the need to manage servers or any other underlying infrastructure.
What is BaaS?
Backend-as-a-Service are third-party API-based services that replace core subsets of functionality in an application. Because those APIs are provided as a service that auto-scales and operates transparently, this appears to the developer to be serverless.
CNCF
Cloud native computing forum
Pros of FaaS
- no provisioning of servers
- automatic scaling
- reduction of costs. Do not pay for idle VMs and do not run replicas for resilience
- underlying servers shared among different function invocations.
Cons of FaaS
- focused on stateless functions (if function should store something then an external storage is needed)
- performance variation due to restart latencies
- not suited for heavy computation workload, own VMs might be cheaper
- limited security: shared VMs, no control over the network
Amazon Lambda
- first serverless offering by a public cloud provider
- designed for:
- image or object uploads to Amazon S3
- updates to DynomoDB tables
- responding to website clicks
- reacting to sensor readings from an IoT connected device
Lambda functions
Anonymous functions in functional programming:
- not bound to an identifier (no function name)
- often used as arguments being passed to higher-order functions
- used in node.js applications
In which programming languages for example can you use Lambda functions?
Node.js
Python
Java
C#
4 advantages of using Amazon Lambda
- Bring your own code
- Simple resource model (select power rating up to 3Gb and CPU and network are allocated automatically)
- Flexible use (integrated with other AWS services)
- Flexible authorization
3 Lambda execution models
- Synchronous (push)
- Asynchronous (event)
- Stream-based
What is Amazon Cognito?
For user management
- secure user sign-up, sign-in, and access control
- supports integration with social and enterprise identity services
- you have a user pool and application id
What is OpenWhisk?
What is Apache OpenWhisk?
Apache OpenWhisk is an open source, distributed Serverless platform that executes functions (fx) in response to events at any scale. OpenWhisk manages the infrastructure, servers and scaling using Docker containers so you can focus on building amazing and efficient applications.
What are the concepts of OpenWhisk?
- trigger (events)
- actions (code):
- functions or binary code in a container
- Json object as input parameter and as return value
- rules connect triggers with actions
- actions (functions) can also be called from e.g. the CML, API
What are the ways to invoce an action on OpenWhisk?
A blocking action is an action that holds up the flow of execution in the system until it completes its execution and returns the result. This means that if one action is executing a blocking operation, no other actions can be executed in the system until the first one is complete.
On the other hand, a non-blocking action does not block the flow of execution in the system. Instead, it allows the system to continue executing other actions even if the non-blocking action has not completed its execution and returned the result. Non-blocking actions are executed asynchronously, which means that the system does not wait for them to complete.
In general, using non-blocking actions is recommended in OpenWhisk to improve the overall performance and scalability of the system.
What is blocking in OpenWhisk?
Call action, wait until action is delivered, then get return-value
What is non-blocking invocation of actions in OpenWhisk?
Call immediately returns and does not wait for the action to be executed.
How does the OpenWhisk Achitecture look like?
Kafka and OpenWhisk can work together by using Kafka as a source of events and OpenWhisk as a way to process and respond to those events in real-time.
What is the cold start time when running a container in OpenWhisk?
Time to prepare the container to run the function.
What are two optimization tasks in OpenWhisk?
- warm containers
- pre-warmed containers
What are warm containers?
- do not delete the containers immediately, grace period
- re-use container for subsequent invocation of same function
What is a pre-warmed container?
-keep a pool of initialized containers (stem cell containers) with heavily used language runtimes