Docsity

Mobile Applications and Cloud Computing Theory, Appunti di Sviluppo di Applicazioni Web

Toggle sidebar
bg1
Why cloud? Historically, the “cloud” symbol was used to indicate anything that is “non local”, typically
residing somewhere in the Internet (“In the cloud”)
•
What is cloud computing? This is not really a new idea: “If computers of the kind I have advocated
become the computers of the future, then computing may someday be organized as a public utility
just as the telephone system is a public utility... The computer utility could become the basis of a new
and important industry.” (John McCarthy, Turing Award, 1961)
•
The path towards cloud computing
The initial days of commercial usage of computing (around 1970s) started with mainframe
system.
○
Mainframes were large supercomputers that required extensive cooling, and the whole system
was so high-priced that it was difficult even for large business organizations to maintain more
than one such system.
○
At that time, organizations used such systems to automate basic data processing tasks, like
payroll management and others.
○
In a sense, cloud computing is a return to the traditional mainframe model
○
•
Mainframe architecture
Mainframes allow users to run programs installed on the mainframe itself, and interaction
with users was through “dumb” terminals: All data stored and computed on the mainframe
○
○
•
Beginning of Client-Server Computing
With the arrival of low-cost microprocessor technology during 1970s, dumb terminal turns to
‘intelligent’ terminals, meaning that may run some light computation on the terminal (they are
after called clients)
○
The role of mainframe was that of a server
○
•
The PC revolution
Introduction of personal computers in 80s, created the scope for computing everything locally
without too much capital investment like for mainframes.
○
Each and every computer could then play the role of a client as well as a server -> However,
servers role were usually assigned to higher performance PC
○
Communication between computers situated a little far from each other was a hurdle until the
invention of LAN and WAN.
○
•
Parallel and Distributed computing
Till the early 1980s, it was believed that computer performance can only be improved by
producing faster and more powerful processors.
○
Invention of parallel processing changed this idea.
○
In parallel processing, a single computation is divided into ‘chucks’ (tasks or jobs) that may run
in parallel (in the same time) on multiple processors.
○
This idea was both applied to the scale of single computers as well as on larger scale giving rise
to the distributed computing model: a single powerful computing system composed of multiple
computing systems instead of one single computer with multiple processors
○
•
Cloud Computing Models
lunedì 30 settembre 2024
12:00
Cloud Computing Page 1
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37
pf38
pf39
pf3a
pf3b
pf3c
pf3d
pf3e
pf3f
pf40
pf41
pf42
pf43
pf44
pf45
pf46
pf47
pf48
pf49
pf4a
pf4b
pf4c
pf4d
pf4e
pf4f
pf50
pf51
pf52
pf53
pf54
pf55
pf56
pf57
pf58
pf59
pf5a
pf5b
pf5c
pf5d
pf5e
pf5f

Anteprima parziale del testo

Scarica Mobile Applications and Cloud Computing Theory e più Appunti in PDF di Sviluppo di Applicazioni Web solo su Docsity!

Why cloud? Historically, the “cloud” symbol was used to indicate anything that is “non local”, typically

residing somewhere in the Internet (“In the cloud”)

What is cloud computing? This is not really a new idea: “If computers of the kind I have advocated

become the computers of the future, then computing may someday be organized as a public utility

just as the telephone system is a public utility... The computer utility could become the basis of a new

and important industry.” (John McCarthy, Turing Award, 1961)

The path towards cloud computing

The initial days of commercial usage of computing (around 1970s) started with mainframe

system.

Mainframes were large supercomputers that required extensive cooling, and the whole system

was so high-priced that it was difficult even for large business organizations to maintain more

than one such system.

At that time, organizations used such systems to automate basic data processing tasks, like

payroll management and others.

○ In a sense, cloud computing is a return to the traditional mainframe model

Mainframe architecture

Mainframes allow users to run programs installed on the mainframe itself, and interaction

with users was through “dumb” terminals: All data stored and computed on the mainframe

○ Text only, 80 columns by 24 lines

Beginning of Client-Server Computing

With the arrival of low-cost microprocessor technology during 1970s, dumb terminal turns to

‘intelligent’ terminals, meaning that may run some light computation on the terminal (they are

after called clients )

○ The role of mainframe was that of a server

The PC revolution

Introduction of personal computers in 80s, created the scope for computing everything locally

without too much capital investment like for mainframes.

Each and every computer could then play the role of a client as well as a server - > However,

servers role were usually assigned to higher performance PC

Communication between computers situated a little far from each other was a hurdle until the

invention of LAN and WAN.

Parallel and Distributed computing

Till the early 1980s, it was believed that computer performance can only be improved by

producing faster and more powerful processors.

○ Invention of parallel processing changed this idea.

In parallel processing, a single computation is divided into ‘chucks’ (tasks or jobs) that may run

in parallel (in the same time) on multiple processors.

This idea was both applied to the scale of single computers as well as on larger scale giving rise

to the distributed computing model: a single powerful computing system composed of multiple

computing systems instead of one single computer with multiple processors

Cloud Computing Models

lunedì 30 settembre 2024 12:

Evolution of PC architecture

  1. Multiple threads on the same processor run concurrently (not in parallel) 2. Multiple threads on multiple cores run in parallel
  • Evolution of the server architecture

HPC and Cluster computing

The concept of clustering appeared as the next step of evolution in the field of computing, to

build High Performance Computers (HPC)

○ Example of computing intensive jobs include running simulations, weather forecast, etc.

One way to build HPC is by cluster computing, where clusters are made of multiple

homogeneous nodes (commodity computers) connected via network which perform similar

tasks.

In each cluster, one computer is assigned the job of controlling the cluster - > That particular

computer (or node) is known as cluster head.

The head’s responsibility in such a simple cluster is to divide and distribute jobs among

different nodes in that cluster when matching computing tasks appear.

Another way to build HPC systems is using specialized hardware components and software

programs.

○ AI raised the interest for GPU based HPC computing

an example (iPSC Hypercube) - 1995

▪ between 32 and 128 nodes

each node has

□ 80286 processor

□ 80287 math co-processor

□ 512K of RAM 8

□ Ethernet ports (7 for other compute nodes, one for control node)

▪ used hypercube connection scheme between processors

▪ base model was 5-dimension hypercube (25 = 32 processors)

HPC vs Cloud computing

on-demand, self-service interface

○ It is the most attractive feature that users like about this computing model.

The on-demand service feature refers to the ability that empowers users to consume the computing facility

as much they need at any moment.

A user himself/herself can request cloud services as needed through some interface (generally through a

user-friendly UI) and resources become available within seconds.

Being self-service, cloud computing can arrange the on-demand facility for users without any need of

human intervention at vendor’s end.

○ No up-front investments

Consume resources only when you need them (on-demand) and without requiring any intervention by the

cloud service provider (self-service)

○ Particularly important when demand is not known in advance

○ Transform CapEx into OpEx

When comparing the economics of on-premise IT to cloud computing, we need to consider the Total Cost of

Ownership (TCO)

TCO includes not only the upfront purchasing cost of hardware and software, it also includes costs for design

and deployment, ongoing infrastructure (software maintenance, upgrades, hardware replacement every three

years), ongoing ops (hiring, training, certifying personnel to operate, administer, monitor infrastructure)

○ TCO = CapEx + OpEx

Moving to the cloud, much of the CapEx are eliminated and much of the OpEx are transformed into

subscription fees

shared infrastructure and resource pooling

A large set of computing resources are managed as a pool, which is maintained at remote locations by the

provider and accessed by all the users

From the cloud provider’s point of view, economies of scale argue for bigger and bigger data centers, exploit

resource efficiently while keeping resources busy as much as possible (close to 100%)

Even if not mentioned in the NIST document multi-tenancy is in fact very important in cloud computing

In simple form multi-tenancy means that a single set of resources has multiple tenants who are not

linked with each other.

Multi-tenancy in cloud computing allows the sharing of same computing resources by different

subscribers without the subscribers being aware of it.

○ Resource pooling allows for flexible usage patterns

3. metered service for pay-as-you-go

Essential characteristics according to NIST

venerdì 4 ottobre 2024 12:

metered service for pay-as-you-go

Service Level Agreement (SLA): set of formal agreements (a contract) between a provider and a consumer of

a service, defining

○ Service Level Indicator (SLI): metric that can be monitored, e.g., response time, or uptime

Service Level Objective (SLO): a predicate over a set of SLIs condition on a measure of a specific metric

▪ Example: 99.999 availability

▪ At least 90% of requests have a response time less than 100 ms

○ penalty and/or compensation in case of SLA violation

Fine-grained metering (minutes, seconds) admits paying for resources only for the period that they are

actually used

“Cost associativity” — “1,000 server hours” of credit can be spent either as “1,000 servers for 1 hour” or “

server for 1,000 hours”

scalability (both scale-up and scale-out)

○ Cloud applications (e.g., e-commerce, social networking, B2B) can experience rapid workload changes

How to determine the amount of resource needed?

▪ Number of hw resources, e.g., servers to switch to standby or active

▪ Capacity of each resource: storage, memory and network resources

▪ Forecast demand for scaling

Services can be scaled to keep up with increasing demand

Scale-up: increase the capacity of resources allocated to the service (also know as vertical

scalability) - > e.g., faster servers, more memory

Scale-out: increase the number of resources allocated to the service (also know as horizontal

scalability) - > more servers to exploit parallelism

rapid elasticity

○ Elasticity is the ability to add or remove resources to better match the demands of a dynamic workload

○ Elasticity means provisioning of adequate and frequently changing demand of resources for many users.

○ Elasticity = Scale-out + Scale-in

Rapid elasticity is the ability to add or remove resources at a fine grain (one server at a time) and with a

small lead time (minutes, seconds or milliseconds) rather than weeks

○ Unprecedented economies of scale are possible by operating extremely large infrastructures

○ Exploit volume discounts for hardware, software, real estate, energy, personnel

○ Fixed costs can be amortized over large number of users

In order to not lose customers or revenue, companies need overprovisioning and adjust resource demands

over time

hybrid cloud

□ Services from public and private clouds are used together within the same organization

Usage examples

Augment private cloud capacity with public clouds at times of peak demand 

Delegate certain functions such as data backup to public clouds 

Leverage the security of private clouds together with the scale of public clouds 

Service delivery model:

▪ This model describes the type of computing service that is offered to users by the service provider

There are three prime categories of service delivery models

1) Infrastructure as a Service (IaaS)

2) Platform as a Service (PaaS)

3) Software as a Service (SaaS)

Advantage of cloud computing

Cloud computing is in a good position to exploit recent advances in software, processor or storage

technologies as cloud is supported by big players

Cloud resources falls in a single administration domain, which makes the management easier respect to a

distributed system

○ Cloud eliminates the up-front financial commitment as it is based on pay-asyou- go price model

○ Users can develop cloud-native applications exploiting from cloud services

  • Some cloud cons

Infrastructure-as-a-Service delivers virtualized-hardware (not physical, but simulated software) resources to consumers known as virtual resources

or virtual components.

  • It provides the facility of remotely using virtual processor, memory, storage and network resources to the consumers.
  • These virtual resources can be used just like physical (hardware) resources to build any computing setup (like virtual machine or virtual network)
  • Responsabilities and management

Unlike traditional managed hosting, which involves leasing entire servers housed in an off-site data center, IaaS providers rely on large-scale data

centers that aggregate substantial amounts of IT resources shared among multiple customers (multi-tenancy).

Key Components:

○ Servers

○ Storage Systems

○ Network Devices

○ Specialized Devices: such as IDS, VPN servers, firewalls, and load balancers.

  • The use of virtualization at all levels (servers, storage, network) allows for high levels of resource utilization.

Public IaaS providers have built several data centers located in multiple countries across all five continents to ensure redundancy and reduce access

latencies.

Example: Google Cloud Platform (GCP)

○ Let’s shortly see how the HW resources are organized with a concrete example, the Google Cloud’s infrastructure

The infrastrutture is based in five major geographic locations: North America, South America, Europe, Asia, and Australia, connected via

highspeed networks and subsea cables

○

○ Locations are currently divided into 40 regions and regions into 121 zones

    • The path towards current IaaS

Infrastructure as a Service (IasS)

lunedì 7 ottobre 2024 12:

○ Zones

How resources are organized? No matter where the resources are placed, they are organized logically into a project, identified by a name and a

number or ID (which is fixed)

○ Network: DC are interconnected by high speed (low latency, high throughput) networks

Where resource are located

  • Data centres are not only a collection of co-located servers wired-up together
  • Services like Gmail or web search run on far beyond a single machine or single rack
  • Rather they run on Warehouse-Scale Computers (WSC), exploiting clusters of hundreds or thousands of individual serves
  • All the connected server is viewed as a (big) computer

Rackmount server

○ The hardware building blocks for WSCs are low-end servers, which are mounted within a rack or a blade enclosure

○ The size of a rackmount server is conventionally indicated in rack units where 1U=44.45mm

○ A sever may occupy 1U or 2U, Additional hardware building blocks, including GPUs and custom accelerators can be also available

○ Configuration: Servers are typically mounted in racks that is 42U high (about 2 m)

Communication network

▪ Servers in a rack are connected to rack switches to allow communication among servers in the same rack, e.g. at 1GbE or 10 GbE

The rack switches (called Top of Rack, ToR) have a number of uplink connections to one or more cluster-level Ethernet switches to reach

other racks, for example 4 Gb or 40 Gb

▪

▪ Switches can be placed in the middle of the rack

○

○ Oversubscription: The ratio between the aggregated capacity of server links and the capacity of uplink links is called the oversubscription ratio

Leaf-spine networks

○ A leaf-spine network is a ‘folded’ Clos 3 stages network

○ This topology is used in DC

Recurrent Clos networks

○ The middle stage can itself implemented ad a smaller clos network

○ This leads to more stages, e.g. 5 stage network

○ The network can be also be folded

Interconnection topology in a DC: Fat-tree

○ Fat-tree is a particular instance of a Clos network, proposed in (),*

Builtusing k-port switches. In the figure, k=

○ The topology has 3 layers, called Edge, Aggregation and Core.

○ There a k pods (point of delivery), divided into 2 parts of k/2 servers each.

○ Each pod contains two layers of k/2 switches

○ Every edge switch connects k/2 server to k/2 aggregation switch

○ Every aggregation switch connects k/2 edge switch to k/2 core switch

○ For any source-destination pair there are k paths (Clos network)

There are are 5/4 k

2

○ switches

The number of servers is k x k/2 x k/2 = k

3

○ /

○ #pods x #switches x #host

Each service exposes a set of endpoints, and it is responsible for a specific business capability and can be developed,

deployed, and scaled independently

▪

Serverless and FaaS (Function as a Service)

○ In Serverless computing execution model developers deploy code without needing to provision or manage servers.

FaaS (Function as a Service) is a subset of PaaS, following an event-driven computation model where the function responds

to ‘events'

○

    • PythonAnywhere is a simple PaaS that allows to deploy Python code
    • It provides many templates, included Flask
    • Flask is a python package that implements web server and RESTful webapi
    • Follow Web - > Add a new web app - > Select a Python Web framework: Flask - > Select a Python version: Python 3.10 (Flask 2.1.2)

API-KEY

○ Some endpoint must be protected by unauthorized accesses

The simplest way is to use an API key, which is sent in any request

The API key is typically generated by the server and provided to the client (could be tied to a specific user or

application).

  1. The client includes the API key in every request, usually in the HTTP headers, query parameters, or body

The server checks if the API key is valid before processing the request. If valid, the request proceeds; if not, the

server returns an error (e.g., 401 Unauthorized).

○

  • List of available API: https://apislist.com/

HW Virtualization

Hardware virtualization involves virtualizing the hardware of a server by creating a Virtual Machine (VM) that provides the

illusion of a physical machine, using a special software called Virtual Machine Manager (VMM) or Hyperviso r - > VM old idea

(1964 IBM’s CP-40).

○

○ Each virtual machine, is composed of a virtual CPU (vCPU), memory, I/O, and network devices

○ This sounds like what an OS does to support multi-programming, right?

○ Each process sees its own CPU, Memory, IO etc. so what is the difference with VMM?

The VMM allows to install different OS, and an OS is different of a usual process as it may run privileged instructions ○

Privileged instructions may vary the state of the physical CPU, or pCPU (like disabling interrupts) - > These instructions should

clearly change the flag in the vCPU, not in the pCPU

○

Over the years, pCPU added native support to VMM to reduce the overhead of running many VMs; this what is meant by hw-

assisted VMM

○

HW Virtualization Model

○ Guest: interacts with virtualization layer rather than with host

○ Virtualization layer (VMM): responsible for recreating same or different HW where guest will operate

Host: original environment ○

HW virtualization should ensure performance isolation - > however, this is challenging: depending on the load on the other

VMs, cache miss rate may for example increase, network bandwidth decrease, etc, (‘noisy neighbours’)

○

In general, when the number of VMs increases behind the real pCPU capabilities, e.g. due to VM overcommitment, the vCPU

clock runs at lower rate

○

In fact, in VM specification the clock rate is not mentioned

Virtualization

lunedì 21 ottobre 2024 12: