FaaS
Virtualization
09/03/2025 1
• FaaS is a cloud computing model that allows developers to run individual
functions or pieces of code in response to events without managing the
underlying infrastructure.
• Serverless Computing: FaaS is a subset of serverless architecture,
where the cloud provider handles resource management and scaling.
09/03/2025 2
Cloud computing models
09/03/2025 3
Serverless: some definitions
«Serverless computing is a method of providing backend services on an as-used basis.
Servers are still used, but a company that gets backend services from a serverless
vendor is charged based on usage, not a fixed amount of bandwidth or number of
servers..»
[Cloudflare]
«A serverless architecture is a way to build and run applications and services
without having to manage infrastructure. Your application still runs on servers, but all
the server management is done by AWS. You no longer have to provision, scale, and
maintain servers to run your applications, databases, and storage systems.»
[Amazon AWS
team]
«A Serverless solution is one that costs you nothing to run if nobody is using it.»
09/03/2025 [Paul Johnston, 4
AWS]
Serverless computing
o Serverless computing is a cloud computing execution model that lets
developers build and run applications without having to manage
servers.
o With serverless, the user is charged for just the resources and storage
they use, while the cloud vendor takes care of all the infrastructure
management and maintenance.
o The main goal of serverless computing is to make it simpler for
developers to write code designed to run on cloud platforms.
o They can write a function in their favorite programming language and
post it to a serverless platform and the cloud provider maps the function
to an API endpoint.
o It plays an important role in digital transformation, both by enabling
developers to focus on code with business value and by eliminating
management overhead.
09/03/2025 5
Advantages
o Cost-effectiveness, as users are only charged for the time code
runs.
o Easy deployment of apps, doing so in hours or days instead of
weeks or months.
o Auto scaling, as providers spin resources up or down when code
isn't running.
o And increased productivity, as developers can spend their time
developing apps instead of dealing with servers.
09/03/2025 6
Disadvantages
o Inefficiency for long-running apps, as it can end up costing more than a VM or
dedicated server.
o Latency, as there's a delay to handle a function for the first time.
o And, debugging is more difficult, because a serverless instance creates a new
version of itself each time it spins up.
09/03/2025 7
Use cases
Serverless computing is suitable for a large variety of use cases,
including:
o Event-triggered computing.
o IoT data processing.
o Back-end tasks for apps or websites.
o Building RESTfull APIs.
o Video and image manipulation.
o Writing multilanguage apps.
09/03/2025 8
How FaaS works?
1. Event Triggering
FaaS functions are typically triggered by events. These can include:
HTTP requests (from web applications or APIs)
File uploads (e.g., to cloud storage)
Database changes (like new records)
Scheduled events (using timers or cron jobs)
Event Handling: When an event occurs, the FaaS platform detects it and
invokes the corresponding function to handle the event.
FFaaS
Faa
event
aassexecute
return &
09/03/2025 destroy 9
How FaaS works?
2. Function Deployment
• Code Packaging: Developers write code for individual functions, which is
packaged along with any necessary dependencies.
• Then, the packaged function is uploaded to the FaaS provider’s
platform. This can often be done through command-line tools or web
interfaces.
• Developers can configure settings such as memory allocation, execution
time limits, and environment variables.
09/03/2025 10
Towards FaaS
09/03/2025 11
FaaS: finer decomposition
09/03/2025 12
How FaaS works?
3. Execution Environment
• Server Management: The FaaS provider manages the underlying infrastructure, including
servers, load balancers, and scaling.
• Runtime Environment: When a function is invoked, the provider sets up a runtime
environment for that function. This can include:
• Allocating resources (CPU, memory)
• Loading the function code
• Initializing any required libraries or dependencies
4. Function Execution
• Each function execution is stateless, meaning it does not retain any data between
invocations. Any required state must be stored externally (e.g., in a database).
• The function executes and processes the input data based on the event that triggered it.
• The execution duration is typically limited to a few seconds to minutes, depending on the
provider.
09/03/2025 13
How FaaS works?
5. Scaling
• FaaS platforms automatically scale the number of function instances
based on demand.
• If multiple events occur simultaneously, the platform can spin up multiple instances of the
function to handle the load.
• Each function can handle multiple concurrent executions, allowing for
efficient processing of numerous events.
6. Monitoring and Logging
• Most FaaS platforms provide monitoring tools to track function
performance, execution times, and error rates.
• Functions can generate logs for each execution, which can be used for
debugging and auditing purposes.
09/03/2025 14
How FaaS works?
7. Billing
• Pay-per-Execution Model: Users are charged based on the number of times a
function is invoked and the duration of execution.
• This pricing model encourages efficient resource use and can lead to cost savings.
8. Integration with Other Services
• Ecosystem Integration: FaaS functions can easily integrate with other cloud
services, such as databases, storage, and messaging systems, enabling
complex workflows and architectures.
Example Workflow
• User Action: A user uploads an image to cloud storage.
• Event Trigger: The upload triggers an event.
• Function Invocation: The FaaS platform invokes a pre-defined function to
process the image (e.g., resize or convert the format).
• Function Execution: The function executes, processing the image.
• Output Handling: The processed image is saved to another storage location or
returned in the response.
09/03/2025 15
Key Characteristics of FaaS
o Event-Driven Execution: Functions are triggered by events such as
HTTP requests, database changes, or file uploads.
o Short-lived Operations: FaaS functions are typically stateless and
designed for short execution times, often completing in seconds or
minutes.
o Automatic Scaling: Functions automatically scale up or down based
on demand, allowing for efficient resource utilization. .
FaaS workflow
The association between a specific event and the execution of one (or maybe
more?) specific function is called FaaS Workflow.
09/03/2025 16
Advantages of FaaS
o Developers focus solely on writing code, without the need to manage
servers or infrastructure.
o Enables quick iteration and deployment of new features.
o Pay only for what you use, reducing costs associated with idle resources.
o Functions can handle varying loads effortlessly, ensuring consistent
performance.
09/03/2025 17
Use Cases for FaaS
o Microservices Architecture: Building small, independent services
that perform specific tasks.
o Real-time Data Processing: Processing streams of data (e.g., logs,
IoT sensor data) in real time.
o API Backends: Creating scalable APIs that respond to web or mobile
application requests.
o Automated Workflows: Automating tasks such as image processing,
data transformation, or notifications based on triggers.
Common FaaS Providers
o AWS Lambda: One of the first FaaS offerings, allowing users to run code in response
to events from other AWS services.
o Google Cloud Functions: Integrates with Google Cloud services and supports
multiple programming languages.
o Microsoft Azure Functions: Provides a serverless compute service that integrates
seamlessly with other Azure services.
o IBM Cloud Functions: Based on Apache OpenWhisk, it enables event-driven
09/03/2025 18
programming.
Difference from PaaS?
•PaaS provides a platform that allows developers to build, deploy, and manage
applications without dealing with the underlying infrastructure.
• Offers a complete development and deployment environment including
operating systems, middleware, and development tools.
• Automatically scales applications based on demand, but users still
manage the application lifecycle.
• Suitable for developing web applications, APIs, and microservices where
developers need more control over the application stack.
•Examples: Google App Engine, Microsoft Azure App Service, Heroku.
o FaaS allows developers to execute code in response to events without managing
servers. It focuses on individual functions or pieces of code.
o Key Features:
o Functions are triggered by specific events (e.g., HTTP requests, database updates).
o Automatically scales based on the execution of functions, with users only paying for
the compute time consumed.
o Ideal for microservices, automated tasks, or event-driven architectures where
specific functions are needed on demand.
o Examples: AWS Lambda, Google Cloud Functions, Azure Functions.
09/03/2025 19
Overall…
Feature PaaS FaaS
Higher management (platform & Lower management (individual
Management Level environment) functions)
Usage Model Continuous applications Event-driven functions
Scaling Scales applications as a whole Scales functions independently
Billing Based on resources allocated Based on execution time of functions
09/03/2025 20
Backend as a Service
• Outsourcing backend
services
• Plug-and-play
API Baa
• Authentication, Database, Alerting, S
Update
09/03/2025 21
FaaS essential components
The Architecture of a FaaS platform includes at
least:
• Trigger
• Controller
• Function Executor
09/03/2025 22
FaaS:
Trigger
• Bridges external events with ones manageable by FaaS
infrastructure.
• Can convert non event-based information into events (eg. Polling)
• Lifecycle and scaling manged by the infrastrucutre
• Can handle different protocols and formats such as (HTTP, TCP…)
FaaS: Controller
• Interacts with external controllers to provision resources
• Handles the delivery of events from trigger to functions
• Manage lifecycle of functions and other FaaS infrastructural components
• Receive configurations from customer and activate workflows
09/03/2025 23
FaaS: Function
Executor
Function Executor:
• Invoker ( or watchdog):
1. Receives events from the controller
2. Runs designate function by passing t
i the event
3. Manages results of execution
• Execution environment
• Isolation(Container, VM)
• Dependencies( O.S., libs…)
• Reproducible
• Logic ( or function)
09/03/2025 24
Function Composition
• Code reusability
• Combine function developed on different frameworks/languages
• Faster Time-to-Market
• Distribution of complex workloads
09/03/2025 25
Function Composition
patterns
In the Function Merging pattern: Two or more functions are merged
in only one which defines also the logic of the composition.
09/03/2025 26
Virtualization
09/03/2025 27
Definition
Virtualization is the ability to run multiple operating systems
on a single physical system and share the underlying
hardware resources
It is the process by which one computer hosts the
appearance of many computers.
Virtualization is used to improve IT throughput and costs by
using physical resources as a pool from which virtual
resources can be allocated.
09/03/2025 28
Virtualization Architecture
• A Virtual machine (VM) is an isolated runtime environment (guest OS and
applications)
• Multiple virtual systems (VMs) can run on a single physical system
09/03/2025 29
Virtualization: rejuvenation
1960’s: first track of virtualization
Time and resource sharing on expensive mainframes
IBM VM/370
Late 1970s and early 1980s: became unpopular
Cheap hardware and multiprocessing OS
Late 1990s: became popular again
Wide variety of OS and hardware configurations
VMWare
Since 2000: hot and important
Cloud computing
Docker containers
09/03/2025 30
Key Components of Virtualization
1. Hypervisors, a.k.a. a virtual machine manager/monitor (VMM),
• A hypervisor is a crucial software layer that enables virtualization by
creating and managing virtual machines (VMs).
• It allows multiple operating systems to share a single hardware host.
• The hypervisor allocates CPU, memory, and storage to each virtual
machine, ensuring they operate independently while managing
resources to prevent disruption between them.
Types:
• Type 1 Hypervisor (Bare-Metal): Runs directly on the physical hardware. It is more
efficient and provides better performance because it doesn’t rely on a host operating
system.
Examples include VMware ESXi, Microsoft Hyper-V, and Xen.
• Type 2 Hypervisor (Hosted): Runs on top of an existing OS. It is generally easier to install
and use for individual users but may introduce some performance overhead.
• Examples include VMware Workstation and Oracle VirtualBox.
09/03/2025 31
Key Components of Virtualization
2. Virtual Machines (VMs)
•A virtual machine is a software emulation of a physical computer,
capable of running its own operating system and applications.
•Characteristics:
• Each VM operates independently, which enhances security and stability. If one VM
crashes, it does not affect others.
• VMs can be configured with varying amounts of resources, allowing for tailored
environments based on application requirements.
•VMs are commonly used for development and testing, running legacy
applications, and creating isolated environments for security purposes.
09/03/2025 32
Key Components of Virtualization
3. Physical Host
•The physical host is the actual hardware on which the hypervisor and
VMs run.
• It includes servers, storage devices, and networking components.
•Components:
• The processor(s) that execute instructions for the hypervisor and VMs.
• The available memory that can be allocated to VMs, impacting their performance.
• Hard drives or SSDs that hold the hypervisor, VMs, and their associated data.
•The performance and capabilities of the physical host directly affect
the efficiency and scalability of the virtualized environment.
• Proper sizing and resource allocation are crucial for optimal performance.
09/03/2025 33
How VMs Work
[Link]
VMs emulate the hardware of a physical machine, including components like the
CPU, memory, and storage.
This emulation allows multiple operating systems to run on a single physical host, as
if each VM were a separate physical machine.
[Link] Operation:
1. Each VM operates independently, running its own OS and applications.
2. This isolation enhances security, as issues in one VM do not affect others, and
allows for flexible resource management and deployment.
09/03/2025 34
How VMs Work
3. Resource Allocation in Virtualization
• Sharing Resources: Hypervisors allocate CPU, memory, and storage
among multiple VMs, ensuring efficient resource use.
• Administrators can dynamically adjust resources based on workload
demands.
4. Isolation and Security
• VMs are isolated from each other, minimizing the risk of one VM affecting
another.
• This isolation enhances security, as vulnerabilities in one VM do not
compromise others.
09/03/2025 35
How VMs Work
5. Snapshots and Cloning
• Capture the state of a VM at a specific point in time, allowing easy
restoration if needed.
• Creates a copy of a VM, useful for testing and development without
affecting the original.
6. Virtual Networking
• Virtual networks allow VMs to communicate with each other and external
networks.
• It includes virtual switches, routers, and firewalls, providing flexible
network configurations.
7. Storage Virtualization
• Combines multiple storage devices into a single virtual storage pool.
• This used to enhance performance and simplifies management, allowing VMs
to access storage resources efficiently.
09/03/2025 36
Benefits of Virtualization
• Sharing of resources helps cost reduction
• Virtual machines are isolated from each other as if they are
physically separated
• Virtual machines encapsulate a complete computing environment
• Virtual machines run independently of underlying hardware
• Virtual machines can be migrated between different hosts.
09/03/2025 37
Virtualization in Cloud Computing
• Cloud computing takes virtualization one step further:
• You don’t need to own the hardware
• Resources are rented as needed from a cloud
• Various providers allow creating virtual servers:
Choose the OS and software each instance will have
The chosen OS will run on a large server farm
Can instantiate more virtual servers or shut down existing ones within minutes
• You get billed only for what you used
09/03/2025 38
Virtualization Security Challenges
• Trusted Computing Base (TCB) in Virtual Machines
• The Trusted Computing Base (TCB) refers to the collection of
hardware firmware, and software components that are critical for
the security of a system.
• These components are responsible for enforcing security policies
and protecting sensitive data.
• In contrast, there is a larger set of components in the system that
may not directly impact security if they fail or behave incorrectly.
• The TCB in VMs includes the hypervisor, guest operating systems,
and any security-related components within the virtualization
environment.
09/03/2025 39
Virtualization Security Challenges
Importance of TCB
1. Security Assurance: The TCB must be inherently secure to ensure that
the overall system remains secure. Any vulnerabilities within the TCB
can lead to breaches and compromise the entire system.
2. Limited Attack Surface: A smaller TCB reduces the potential points of
attack for malicious entities. Fewer components mean fewer
opportunities for exploitation.
Challenges with Large TCBs
• A larger TCB complicates security management.
• It increases vulnerability risks.
• It makes updates more challenging.
09/03/2025 40
Virtualization Security Requirements
A client uses the service of a cloud computing company to build a
remote VM
A secure network interface
A secure secondary storage
A secure run-time environment (Build, save, restore, destroy)
A secure run-time environment is the most fundamental
The first two problems already have solutions:
Network interface: Transport layer security (TLS)
Secondary storage: Network file system (NFS)
The security mechanism in the first two rely on a secure run-time
environment
All the cryptographic algorithms and security protocols reside in the run-time environment
09/03/2025 41
Smaller TCB Solution
Smaller TCB
Actual TCB
09/03/2025 42