Cloud Computing: Introduction to Serverless
37 Questions
0 Views

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to Lesson

Podcast

Play an AI-generated podcast conversation about this lesson

Questions and Answers

Which of the following best describes the evolution from traditional architectures to Function as a Service (FaaS)?

  • From functions to microservices, then to monolith, representing decreasing concern over stack implementation.
  • From monolith to microservices, then to functions, representing increasing concern over stack implementation.
  • From monolith to microservices, then to functions, representing increasing focus on business logic. (correct)
  • From monolith to microservices, then to functions, representing decreasing focus on business logic.

In the context of serverless computing, what does the term 'ephemeral' refer to?

  • The short-lived existence of compute containers, potentially lasting only for one invocation. (correct)
  • The fully managed aspect of the serverless platform by a third party.
  • The stateless nature of compute containers.
  • The event-triggered nature of the serverless functions.

According to NIST, what aspect of application hosting is removed by serverless FaaS, compared to PaaS?

  • The ability to deploy applications onto the cloud infrastructure.
  • Control over the underlying cloud infrastructure. (correct)
  • The use of programming languages and tools supported by the provider.
  • Control over the deployed applications themselves.

In a serverless architecture, what role does an API Gateway play?

<p>It acts as an HTTP server, routing requests to the appropriate serverless functions based on defined endpoints. (C)</p> Signup and view all the answers

What is a key characteristic of the serverless approach to application architecture?

<p>It favors choreography over orchestration, allowing components to play architecturally aware roles. (B)</p> Signup and view all the answers

In a serverless architecture for a UI-driven application, how does the client interact with the backend?

<p>The client uses indirect access to a database or services with Authentication as a Service via API Gateway. (D)</p> Signup and view all the answers

What is a significant advantage of using FaaS, according to Amazon?

<p>FaaS allows you to run code without provisioning or managing servers. (D)</p> Signup and view all the answers

What billing model is typically used in FaaS?

<p>Billing based on the compute time consumed, often measured in milliseconds. (B)</p> Signup and view all the answers

Which of the following is a key characteristic of FaaS regarding programming languages?

<p>FaaS offerings support a wide range of languages as long as the code can compile down to a Unix process. (C)</p> Signup and view all the answers

In a FaaS environment, what is the developer primarily responsible for regarding resource provisioning?

<p>Uploading the code for the function, while the provider handles resource provisioning. (D)</p> Signup and view all the answers

What does 'automatic scalability' mean in the context of FaaS?

<p>The FaaS platform automatically adjusts resources to handle varying levels of demand. (A)</p> Signup and view all the answers

How are functions typically triggered in a FaaS environment?

<p>By defining specific event types supported by the provider, such as file updates or scheduled tasks. (B)</p> Signup and view all the answers

What does it mean for a FaaS function to be 'stateless'?

<p>Any state required to be persistent must be externalized outside of the FaaS function instance. (A)</p> Signup and view all the answers

What is a typical time limitation for the execution of a FaaS function like AWS Lambda, before it is terminated?

<p>AWS Lambda function at most five minutes, before being terminated. (D)</p> Signup and view all the answers

What does a 'cold start' refer to in the context of FaaS?

<p>Creating a new container instance and starting the function host process. (D)</p> Signup and view all the answers

Which of the following factors can affect the duration of a cold start in FaaS?

<p>The programming language, number of libraries used, amount of code, and configuration of the function environment. (A)</p> Signup and view all the answers

What is the role of an API gateway in a serverless architecture?

<p>To find the routing configuration matching the request. (D)</p> Signup and view all the answers

What is a key function that API gateways may perform beyond routing requests?

<p>Authentication, input validation, and response code mapping. (B)</p> Signup and view all the answers

Which of the following is a characteristic of FaaS scaling?

<p>Automatically managed, transparent, and fine-grained. (A)</p> Signup and view all the answers

Which of the following is a potential benefit of serverless computing?

<p>All of the above. (D)</p> Signup and view all the answers

What is a significant drawback of serverless computing as discussed in the lecture?

<p>Vendor lock-in. (A)</p> Signup and view all the answers

Which type of applications would most likely benefit from Serverless architecture?

<p>short-running. (A)</p> Signup and view all the answers

Which of the following is considered an open issue in serverless computing?

<p>Techniques to minimize the cold start problem while still scaling to zero. (B)</p> Signup and view all the answers

Considering the evolution of computing paradigms, which platform requires the most effort in managing the operating system?

<p>IaaS (Infrastructure as a Service). (A)</p> Signup and view all the answers

In the context of serverless computing costs, what is the primary factor that determines the cost of running a function using FaaS?

<p>How much the function is called. (C)</p> Signup and view all the answers

In a transition from a traditional three-tier application to a serverless architecture, which component typically handles authentication?

<p>Authentication as a Service (BaaS). (C)</p> Signup and view all the answers

Which of the following is an example of an event that can trigger a FaaS function in Amazon AWS?

<p>S3 file/object updates. (B)</p> Signup and view all the answers

What is the primary reason data must be externalized from a FaaS function to maintain state?

<p>There is no guarantee such state is persisted across multiple invocations. (C)</p> Signup and view all the answers

Compared to PaaS, what does FaaS offer in terms of scaling?

<p>FaaS offers more efficient scaling. (C)</p> Signup and view all the answers

A development team wants to deploy an application that has a very uneven traffic shape. Which deployment model could save money?

<p>FaaS. (A)</p> Signup and view all the answers

When is the best time to use serverless functions rather than traditional computing?

<p>For applications easily divided into stateless, event-driven components. (D)</p> Signup and view all the answers

Choose the correct answer: is serverless good for number crunching?

<p>No. (A)</p> Signup and view all the answers

The cold start of the lambda function can depend on:

<p>All of the above. (D)</p> Signup and view all the answers

Benefits in using FaaS regarding costs are:

<p>All of the above. (D)</p> Signup and view all the answers

A company is using AWS Lambda functions and they want to prevent the vendor lock-in, what can they do?

<p>They can start using Serverless Framework, which aims to make working with AWS API Gateway and Lambda easier. (B)</p> Signup and view all the answers

In a context where the existing legacy code can be automatically decomposed into smaller-granularity pieces, what can you do?

<p>You can semicolumn automatically decompose it into smaller-granularity pieces. (A)</p> Signup and view all the answers

The edge of the Serveless it's intended to support for:

<p>For events that are typically generated. (C)</p> Signup and view all the answers

Flashcards

What is IaaS?

Virtual servers available in the cloud. They are bare machines.

What is PaaS?

Virtual application platforms, such as Python Flask, Node JS Express, and JAVA Spring Boot.

What is Serverless Computing?

Provides compute resource abstraction to its logical conclusion. You don't manage servers.

Serverless in the context of BaaS

Applications that significantly or fully incorporate third-party, cloud-hosted applications and services to manage server-side logic and state.

Signup and view all the flashcards

Serverless in the context of FaaS

Applications where server-side logic is written but run in stateless compute containers that are event-triggered, ephemeral, and fully managed by a third party.

Signup and view all the flashcards

PaaS definition by NIST

The ability to deploy consumer-created applications onto the cloud infrastructure, without managing the underlying infrastructure.

Signup and view all the flashcards

Serverless FaaS

Removing user control over hosting to provide simpler scaling and a more attractive billing model.

Signup and view all the flashcards

What is an API Gateway?

An HTTP server where routes and endpoints are defined, with each route associated with a resource to handle that route.

Signup and view all the flashcards

AWS Lambda definition

AWS Lambda lets you run code without provisioning or managing servers.

Signup and view all the flashcards

FaaS Pricing model

You pay only for the compute time you consume hence there is no charge when your code is not running».

Signup and view all the flashcards

FaaS compatibility

FaaS offerings do not require coding to a specific framework or library.

Signup and view all the flashcards

FaaS deployment

Upload your code and the FaaS provider handles provisioning resources, instantiating VMs, managing processes, etc.

Signup and view all the flashcards

FaaS Scalablity

Horizontal scaling is completely automatic, elastic, and managed by the provider.

Signup and view all the flashcards

FaaS event triggers

Functions are typically triggered by event types defined by the provider.

Signup and view all the flashcards

Local State

Data must be stored in variables inside memory or in a local disk

Signup and view all the flashcards

Invocations

Guarantees for such state is persisted across multiple invocations

Signup and view all the flashcards

Invocation time

FaaS functions are typically limited in how long each invocation is allowed to run

Signup and view all the flashcards

Startup latency

It takes some time for a FaaS platform to initialize an instance of a function before each event.

Signup and view all the flashcards

Warm start

using an instance of a Lambda function and its host container from a previous event

Signup and view all the flashcards

Cold startup

creating a new container instance, starting the function host process, etc.

Signup and view all the flashcards

Serverless FaaS scaling characteristics

Automatically managed, transparent, and fine-grained scaling, tied in with automatic resource provisioning and allocation.

Signup and view all the flashcards

Benefits of Serverless Computing

Reduced operational cost, reduced development cost, reduced execution costs, and greener computing.

Signup and view all the flashcards

Drawbacks of Serverless Computing

Vendor control, multitenancy problems, vendor lock-in, execution duration, startup latency, and testing difficulties.

Signup and view all the flashcards

Cold start problem in serverless

Techniques to minimize the cold start problem while still scaling to zero are critical.

Signup and view all the flashcards

Open source Serverless projects

Kubeless, OpenFaaS, and Fn Project.

Signup and view all the flashcards

Study Notes

  • The presentation is titled "Cloud Computing: Introduction to Serverless Computing".

What is Serverless Computing?

  • With IaaS (Infrastructure as a Service), virtual servers are provided in the cloud, but they are bare machines
  • PaaS (Platform as a Service) provides virtual application platforms, eliminating the need to manage the OS and manage scalability
  • PaaS does not automate running numerous microservices and requires container orchestration platforms
  • Serverless Computing provides compute resource abstraction to its logical conclusion

Evolution of Computing

  • Computing has evolved to increase the focus on business logic and decrease the concern over stack implementation
  • The progression is from Bare Metal -> Virtual Machines -> Containers -> Functions

What is Serverless?

  • There is no one clear definition of Serverless
  • In the first case (BaaS):
    • Serverless describes applications that use third-party, cloud-hosted applications and services to manage server-side logic and state
    • It uses "rich client" applications which use cloud-accessible databases and authentication services
    • These services are "(Mobile) Backend as a Service" (BaaS)
  • In the second case (FaaS):
    • Serverless means applications where server-side logic is written but run in stateless compute containers that are event-triggered
    • These containers are ephemeral and fully managed by a third party
    • One way to think of this is "Functions as a Service" (FaaS)

NIST Definition of PaaS

  • PaaS means "the capability provided to the consumer is to deploy onto the cloud infrastructure consumer-created or acquired applications created using programming languages and tools supported by the provider"
  • The consumer manages the applications and not the cloud infrastructure

Serverless FaaS

  • Serverless FaaS removes user control over hosting to provide simpler scaling and a more attractive billing model

Serverless Architecture

  • In a serverless architectural system, the Edge consists of a UI, API Gateway and Cloud Event Sources
  • These connect to the Master, which consists of an Event Queue and Dispatcher
  • The Dispatcher connects to Workers

UI-Driven Applications

  • Traditional three-tier client-oriented systems use server-side logic
  • In this system, Logic in the system (authentication, page navigation, searching, transactions) implemented by the server application
  • Serverless Architecture features a service for Authentication, direct access to a Database and split purchase/search functionality
  • FaaS functions respond to HTTP requests instead of having an always-running server

No Centralized Management

  • In a Serverless architecture there is no central arbiter, instead there is more choreography over orchestration
  • It shares principles with a microservices approach:
    • Flexibility
    • Extendibility
    • Division of concerns
    • Cost reduction
    • Higher complexity

Example: Message-Driven Application

  • Message-Driven applications are for backend data-processing services
  • Serverless versions replace the long-lived message-consumer application with a "click processor" FaaS function
  • The architecture becomes smaller and the system becomes event driven

What is FaaS (According to Amazon)

  • "AWS Lambda lets you run code without provisioning or managing servers"
  • "With Lambda, you can run code for virtually any type of application or backend service - all with zero administration"
  • "Just upload your code and Lambda takes care of everything required to run"
  • "and scale your code with high availability"
  • "You can set up your code to automatically trigger from other AWS services"
  • "or call it directly from any web or mobile app"

AWS Lambda

  • AWS Lambda allows the user to "run code without provisioning or managing servers."
  • FaaS is about running backend code without managing your own server systems or your own long-lived server applications
  • A provisioned server and an always-running application are unnecessary

Subsecond Metering

  • With AWS Lambda, "You pay only for the compute time you consume - there is no charge when your code is not running."
  • So, one is charged for every 100ms the code executes and the number of times the code is triggered

Language Agnostic

  • According to AWS, "With Lambda, you can run code for virtually any type of application or backend service - all with zero administration."
  • FaaS offerings do not require coding to a specific framework or library
  • FaaS functions are regular applications when it comes to language and environment
  • AWS Lambda functions can be implemented in Javascript, Python, Go, any JVM language (Java, Clojure, Scala, etc.), or any .NET language or any language that can compile down to a Unix process

Resource Provisioning

  • According to AWS, "Just upload your code and Lambda takes care of everything required to run."
  • Deployment is very different from traditional systems
  • In a FaaS environment we upload the code for our function to the FaaS provider, and the provider does everything else

Automatic Scalability

  • According to AWS, "and scale your code with high availability."
  • Horizontal scaling is completely automatic, elastic, and managed by the provider
  • The vendor handles all underlying resource provisioning and allocation–no cluster or VM management is required by the user at all

Events

  • Functions in FaaS are typically triggered by event types defined by the provider
  • Amazon AWS includes S3 (file/object) updates, time (scheduled tasks), and messages added to a message bus

HTTP Requests

  • "Or call it directly from any web or mobile app"
  • Most providers allow functions to trigger as a response to HTTP requests by using an API gateway

Stateless

  • FaaS functions have restrictions when it comes to local state stored in variables in memory, or in a local disk
  • There is no guarantee that such state is persisted across multiple invocations
  • FaaS functions are described as stateless, so any required consistent state must be externalized outside of its instance

Function Duration

  • FaaS functions are usually limited in how long they are allowed to run
  • AWS Lambda functions run for five minutes at most
  • Long-lived tasks are not suited to FaaS functions

Startup Latency

  • It takes some time for a FaaS platform to initialize an instance of a function before each event, from a few milliseconds to several seconds
  • Initialization of a Lambda function include either:
    • Warm Start, reusing an instance of a Lambda function and its host container from a previous event
    • Cold Start, creating a new container instance, starting the function host process, etc
  • Cold start may depend on the programming language, how many libraries are used, how much code there is, and the configuration of the Lambda function environment

Function Life-Cycle

  • Check if an instance is running
  • Either activate the process, or start an instance
  • Handle the request and stop the process

API Gateway

  • An API gateway is an HTTP server where routes and endpoints are defined in configuration
  • Each route is associated with a resource to handle that route
  • Handlers are often FaaS functions in Serverless architecture
  • When an API gateway receives a request, it finds the routing configuration matching the request.
  • In the case of a FaaS backed route, it will call the relevant FaaS function
  • The FaaS function executes its logic and returns a result to the API gateway
  • This result is transformed into an HTTP response that is given to the original caller
  • API gateways may also perform authentication, input validation, response code mapping, and more
  • Amazon's API Gateway is a BaaS service that does not need to be provisioned

Serverless Computing Vendors

  • Amazon has the most recognized Serverless Computing offering, with AWS Lambda
  • Other vendors include Google Cloud Functions, Azure Functions, IBM Cloud Functions, and Pivotal Function Service
  • All of them enable you to deploy functions that are executed on-demand and billed by the millisecond of execution time
  • Open source Serverless projects include Kubeless, OpenFaaS, and Fn Project

Open Source in the FaaS World

  • Serverless Framework: aims to make easier use of tooling provided by AWS and also cross-vendor abstraction.
  • AWS's own deployment tool, SAM(Serverless Application Model)is also open source.
  • Apache OpenWhisk is an open source FaaS platform
  • Microsoft open sourced much of its Azure Functions platform

Comparison with PaaS

  • PaaS applications bring entire applications up and down in response to an event
  • FaaS platforms do exactly this.
  • FaaS and PaaS are different in scaling
  • FaaS scales automatically, transparently, and finely.
  • This is tied in with the automatic resource provisioning and allocation

Benefits of Serverless Computing

  • Reduced operational cost (Serverless is, at its most simple, an outsourcing solution)
  • Reduced development cost (A BaaS database removes much of the database administration overhead)
  • Reduced packaging and deployment complexity
  • Reduced time to market and high flexibility
  • Reduced execution costs (save money using FaaS unless your server use is near its limits)
  • Greener computing (Reduce inefficiency)

Benefits at a Glance

  • Serverless provides milliseconds of provisioning time and blocks of milliseconds for charging granularity
  • It also has blocks of milliseconds of costs
  • Virtual Machines provide minutes of provisioning time and hours for charging granularity
  • Containers provide seconds/minutes of provisioning time and minutes for charging granularity
  • On Premise provides minutes of provisioning time and fixed costs

Drawbacks of Serverless Computing

  • Vendor control and forced API upgrades may be an issue
  • There may be multitenancy problems, vendor lock-in, execution duration, startup latency, and difficult testing
  • Security, robustness and performance problems may also occur

Open Issues

  • Minimizing the cold start problem
  • Degree to automatically decompose legacy code
  • Applications may fail without supporting stateful serverless applications with QoS
  • Service relies such as identity providers may be unavailable
  • Support for events that can be generated at the edge through increased adoption of IoT and mobile devices

When is Serverless Good?

  • When it is short-running, stateless or event-driven
  • Use for Microservices, Mobile Backends, Bots, ML Inferencing, IoT, Modest Stream Processing and Service Integration

When is Serverless not Good?

  • When it is long-running, stateful or requires number crunching
  • Use for Databases, Deep Learning Training, Heavy-Duty Stream Analytics, Spark/Hadoop Analytics, Numerical Simulation and Video Streaming

Studying That Suits You

Use AI to generate personalized quizzes and flashcards to suit your learning preferences.

Quiz Team

Related Documents

Description

This presentation introduces serverless computing and its evolution from bare metal to virtual machines to containers to functions. Serverless computing abstracts compute resources, increasing focus on business logic and decreasing concern over stack implementation. It uses third-party, cloud-hosted applications.

More Like This

Serverless Computing Overview
11 questions
AWS Cloud Services Overview Quiz
10 questions
Serverless Computing Basics
16 questions
Use Quizgecko on...
Browser
Browser