L10 - FaaS Flashcards

1
Q

severless meaing

A

application owners do not have to worry about the underlying execution infrastructure, mostl importantly physical or virtual servers.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is often used as a synonym for FaaS?

A

Serverless computing

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

A serverless computing platform may provide one or both of the following

A
  1. Function-as-a-Service (FaaS)
  2. Backend-as-a-Service (Baas)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is FaaS?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is BaaS?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

CNCF

A

Cloud native computing forum

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Pros of FaaS

A
  • 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.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Cons of FaaS

A
  • 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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Amazon Lambda

A
  • 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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Lambda functions

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

In which programming languages for example can you use Lambda functions?

A

Node.js
Python
Java
C#

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

4 advantages of using Amazon Lambda

A
  • 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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

3 Lambda execution models

A
  • Synchronous (push)
  • Asynchronous (event)
  • Stream-based
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is Amazon Cognito?

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is OpenWhisk?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What are the concepts of OpenWhisk?

A
  • 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
17
Q

What are the ways to invoce an action on OpenWhisk?

A

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.

18
Q

What is blocking in OpenWhisk?

A

Call action, wait until action is delivered, then get return-value

19
Q

What is non-blocking invocation of actions in OpenWhisk?

A

Call immediately returns and does not wait for the action to be executed.

20
Q

How does the OpenWhisk Achitecture look like?

A

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.

21
Q

What is the cold start time when running a container in OpenWhisk?

A

Time to prepare the container to run the function.

22
Q

What are two optimization tasks in OpenWhisk?

A
  • warm containers
  • pre-warmed containers
23
Q

What are warm containers?

A
  • do not delete the containers immediately, grace period
  • re-use container for subsequent invocation of same function
24
Q

What is a pre-warmed container?

A

-keep a pool of initialized containers (stem cell containers) with heavily used language runtimes

25
Q

Does OpenWhisk support different container factories?

A

Container factories are a set of tools and services that are used to create and manage containers for running cloud applications and services.

Yes. e.g.:

-Docker
- Kubernetes
- Mesos

26
Q

How to use OpenWhisk on top of Kubernetes?

A

OpenWhisk can be run on top of Kubernetes by deploying the OpenWhisk components as containers within a Kubernetes cluster.

  • Kubernetes manages the control plane of OpenWhisk (Controller, Invoker etc.)
  • Docker Container Factory (Docker is used to create the containers)
    K8s container factory:
  • small number of invokers
  • user containers are wrapped into pods
  • invokers start pods on a worker node
27
Q

What are the pros and cons of using OpenWhisk on top of K8s?

A

Pros:
- resuses infrastructure of K8s
- can be used with other container runtimes e.g. containerd
Cons:
- longer cold-start latency (because of K8s overhead)

28
Q

What is the characteristic of OpenWhisk functions and how do they perform complex operations?

A
  • small, simple, stateless
  • require sequences (chaining) for more complex operations
  • e.g first detect the language of a document and then translate it
29
Q

What are 4 approaches for function composition in OpenWhisk?

A
  • 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: First function triggers the next

–> drawback: you have to write special code
- Primitive sequence in OpenWhisk

30
Q

What are the advantages of a primitive sequence in OpenWhisk?

A
  • requires no change or knowledge of the composed functions
  • requires no change to the client code
  • does nto inflate costs
  • build into OpenWhisk runtime
30
Q

What are the advantages of a primitive sequence in OpenWhisk?

A
  • requires no change or knowledge of the composed functions
  • requires no change to the client code
  • does nto inflate costs
  • build into OpenWhisk runtime
31
Q

Alternative to a primitive sequence?

A

Apache OpenWhisk Composer:
- Java script library to program compositions
- Workflow compositions: sequence, loops, parallel, if..
- AWS step functions

32
Q

What is the Serverless Framework?

A

Cross-platform deployment and management tool
- supports major FaaS implementation of cloud providers
- template for cloud provider and function language
- CML tool that works for all cloud providers

Automatic instrumentation:
enabling monitoring and debugging

internet:
The Serverless Framework is an open-source framework for building and deploying serverless applications. It provides a platform for defining, deploying, and managing serverless functions and other cloud resources using a simple, declarative syntax.

The Serverless Framework supports a variety of cloud providers, including AWS Lambda, Microsoft Azure Functions, Google Cloud Functions, and others, allowing developers to build and deploy their serverless applications across multiple cloud platforms.

33
Q

Name 4 paid FaaS providers and 2 open source providers

A
  • Google Cloud Functions
  • IBM Cloud Functions
  • Microsoft Azure Functions
  • Huawei Cloud Functions

Open Source:
- OpenWhisk
- OpenFaaS
- Kubeless

34
Q

When to use serverless?

A

Use if:
- easily decomposable functions
- highly-variable demand (fast response time needed)
- no high frequency in triggering
- overhead of running instances is high
- need for tight integration to cloud events

35
Q

When to be cautious about using serverless?

A
  • you don’t want to lock-in to a cloud
  • demand is not variable