CLOUD PROGRAMMING
AND
SOFTWARE ENVIRONMENTS
Module-5
1
CLOUD COMPUTING
Features of Cloud Computing:
On-demand self-service: Users can access resources as needed
Scalability : Resources can be increased or decreased easily.
Resource pooling: Multiple users share resources securely.
Broad network access: Services are available over the internet on any device.
Pay-per-use model: You only pay for what you use.
Automatic updates: Cloud services are updated automatically by the provider.
High availability: Cloud services offer strong uptime and data backup.
2
GRID COMPUTING
Features of Grid Computing:
Resource sharing: Connects many computers to share resources like CPU or
storage.
Distributed computing: Tasks are divided and processed across multiple
systems.
High performance: Suitable for complex computations and scientific tasks.
Scalability: More computers can be added to improve performance.
Heterogeneous resources: Works with different hardware and operating
systems.
Decentralized: No single point of control, resources are managed locally.
Collaboration: Often used in academic or research collaborations.
3
CLOUD VS GRID
Cloud Computing Grid Computing
Uses Client- Server Computing Architecture Uses Distributed Computing Architecture
Resources are used in centralized pattern Resources are used in collaborative pattern
The users pay for the use The users do not pay for use.
A high accessible service. A low accessible service.
Highly Scalable Compared to Grid Low Scalable compared to Cloud
Accessed through standard web protocols Accessible through grid middleware.
Focus on accessibility and cost efficiency Focus on high-performance computing and resource
sharing across different domains
4
AWS
It is a subsidiary of Amazon, launched in 2006
provides on-demand cloud computing platforms
It follows a Pay-as-you-go model
The infrastructure is organized as a hierarchy:
Regions: Physical locations around the world (e.g., US East, Asia Pacific/Mumbai)
Availability Zones (AZs): Each Region contains multiple, isolated data centres
Edge Locations: Smaller sites used to cache content (like Netflix videos) closer
to users for faster loading
5
AWS
Service Category Core Service Function Practical Use Case
Amazon EC2 (Elastic Hosting a web application or
Compute Provides resizable virtual servers.
Compute Cloud) running custom software.
Amazon S3 (Simple Storage Object storage built to store and Storing website images, videos,
Storage
Service) retrieve any amount of data. or system backups.
Managed service for relational Managing user profiles,
Amazon RDS (Relational
Database databases (MySQL, PostgreSQL, transaction logs, and structured
Database Service)
etc.). data.
Creating a secure, private
Amazon VPC (Virtual Private A logically isolated section of the
Networking network environment for your
Cloud) AWS network.
servers.
Speeding up the delivery of files
A fast Content Delivery Network
Content Delivery Amazon CloudFront to users globally via Edge
(CDN) service.
Locations.
Runs code in response to events Automatically resizing an image
Serverless AWS Lambda
without managing servers. as soon as it is uploaded to S3.
Giving a developer permission to
AWS IAM (Identity & Access Controls who can access which
Security access a database but not the
Management) AWS resources.
billing info. 6
AZURE
Microsoft's public cloud platform, launched in 2010
provides on-demand cloud computing platforms
It follows a Pay-as-you-go model
The infrastructure is organized as a hierarchy:
Regions: Physical locations around the world (e.g., US East, Asia Pacific/Mumbai)
Availability Zones (AZs): Each Region contains multiple, isolated data centres
Azure Local: allows companies to run Azure services on their own local
hardware for high-speed performance
7
AZURE
Service Category Core Service Function Practical Use Case
Scalable, on-demand Windows or Linux Deploying a legacy enterprise application
Compute Azure Virtual Machines
computing resources. that requires a specific OS.
Highly scalable object storage for Storing massive datasets for research,
Storage Azure Blob Storage
unstructured data. logs, or website media.
A fully managed Relational Database-as- Building a high-performance web app
Database Azure SQL Database
a-Service (DBaaS). with automatic scaling and patching.
Azure Virtual Network A private network that allows Azure Connecting a front-end web server to a
Networking
(VNet) resources to securely communicate. back-end database securely.
Event-driven, serverless compute Triggering a data cleanup script every
Serverless Azure Functions
platform. time a user deletes their account.
A cloud-based identity and access Managing "Single Sign-On" (SSO) so
Identity Microsoft Entra ID
management service. students can log in with one account.
Access to powerful AI models like GPT- Integrating a chatbot or text summarizer
AI & ML Azure OpenAI Service
4 via Azure. into a college portal.
8
GCP
Suite of cloud services by Google, launched in 2008
provides on-demand cloud computing platforms
It follows a Pay-as-you-go model
The infrastructure is organized as a hierarchy:
Regions: Physical locations around the world (e.g., US East, Asia Pacific/Mumbai)
Zones: A region is subdivided into three or more zones
Edge Networks: maintains hundreds of Points of Presence (PoPs) that are used
to cache content close to end-users
9
GCP
Service Category Core Service Function Practical Use Case
Virtual Machines running on Google's Running a web server that requires
Compute Compute Engine
high-performance fiber network. specific OS configurations.
World-wide, continuous object Hosting high-resolution images or
Storage Cloud Storage
storage for any data type. video files for a mobile app.
Managed relational database service
Storing structured user data like login
Database Cloud SQL for MySQL, PostgreSQL, and SQL
credentials or order history.
Server.
Connecting your virtual machines
Virtual Private Cloud A global, managed network for your
Networking across different global regions
(VPC) Google Cloud resources.
securely.
Build and deploy containerized apps Hosting a "pay-as-you-go" API that
Serverless Cloud Run
that scale automatically to zero. only costs money when used.
A serverless, highly scalable multi- Processing billions of rows of sensor
Data Analytics BigQuery
cloud data warehouse. data to find trends in real-time.
A unified platform to train, tune, and Building an image recognition tool or
AI & ML Vertex AI
deploy AI models (including Gemini). a custom language model.
10
PARALLEL & DISTRIBUTED PROGRAMMING PARADIGM
A Distributed computing system is a set of computational engines connected by
a network to achieve a common goal of running a job or an application
A Parallel computing is the simultaneous use of more than one computational
engine (not necessarily connected via a network) to run a job or an application
Running a parallel program on a distributed computing system (parallel and
distributed programming) has several advantages:
it decreases application response time
it increases throughput and
it increases resource utilization
11
PARALLEL & DISTRIBUTED PROGRAMMING PARADIGM
Issues for running a typical parallel program in either parallel or distributed system:
Computation partitioning: splitting a given job or a program into smaller tasks
Data partitioning: splitting the input or intermediate data into smaller pieces
Mapping: assigning either smaller parts of a program / the smaller pieces of data
to underlying resources
Synchronization: synchronization and coordination among workers is necessary
Communication: communication among workers when the intermediate data is
sent to workers
Scheduling: scheduling is necessary when system resources are not sufficient to
simultaneously run multiple jobs or programs
12
MAPREDUCE
It is a software framework which supports parallel and distributed computing on
large data sets
It abstracts the data flow of running a parallel program on a distributed computing
system
It provides 2 interface in the form of functions: Map and Reduce
Users can override these two functions to interact with and manipulate the data
flow of running their programs.
The MapReduce Framework is shown in the following diagram
13
MAPREDUCE
MapReduce Framework
14
MAPREDUCE
First, the user overrides the Map and Reduce functions
then invokes the MapReduce (Spec, &Results) function from the library to start
the flow of data.
The ‘spec’ object is initialized inside the user’s program, and then the user writes
code to fill it with the names of input and output files, optional tuning parameters,
and also the name of the Map and Reduce functions
The overall structure of a user’s program containing the Map, Reduce, and the Main
functions is given as follows:
15
MAPREDUCE
16
MAPREDUCE
The input data to the Map function is in the form of a (key, value) pair
The output data from the Map function is structured as (key, value) pairs called
intermediate (key, value) pairs.
The MapReduce framework forms groups by first sorting the intermediate (key,
value) pairs and then grouping values with the same key
The Reduce function receives these groups
The Reduce function processes each (key, [set of values]) group and produces a set
of (key, value) pairs as output.
17
MAPREDUCE
Working of MapReduce
18
MAPREDUCE
Word Counting Example
19
MAPREDUCE
Steps of MapReduce Framework:
Data Partitioning: splits input data into M pieces that corresponds to number of
map tasks
Computation Partitioning: generates copies of user program containing map
and reduce functions, distributes them, starts them
Determining Master and Workers: one node becomes master, rest as workers
Reading the Input Data: map worker reads corresponding portion of input data
and sends it to map function
Map Function: receives the input data (key, value) pair, processes it and produces
intermediate (key, value) pair
20
MAPREDUCE
Steps of MapReduce Framework:
Combiner Function: optional local function, merges local data of each map
worker before sending it over the network
Partitioning Function: intermediate (key, value) pairs produced by each map
worker are partitioned into R regions(equal to the number of reduce tasks) with
identical keys are stored in the same region
Synchronization: applies a simple synchronization policy to coordinate map
workers with reduce workers
21
MAPREDUCE
Steps of MapReduce Framework:
Communication: reduce worker, j, uses a remote procedure call to read the
data from the respective region, Rj, of all map workers.
Sorting and Grouping: reduce worker groups intermediate (key, value) pairs by
sorting the data based on their keys, followed by grouping all occurrences of
identical keys
Reduce Function: processes its input data and stores the output results in
predetermined files
22
MAPREDUCE
Data Flow in MapReduce 23
MAPREDUCE
Control Flow in MapReduce 24
TWISTER PARADIGM
Mapreduce is slower compared to MPI for 2 reasons:
MapReduce reads and writes via files, whereas MPI transfers information directly
between nodes over the network
MPI does not transfer all data from node to node, but just the amount needed to update
information (called δ flow)
The above issues can be addressed with following changes:
Stream information between steps without writing intermediate steps to disk
Use long-running threads or processors to communicate the δ flow (between iterations)
25
TWISTER PARADIGM
Twister for iterative MapReduce programming
26
HADOOP
an open-source implementation of MapReduce by Apache Software Foundations
It is used to store and process large amounts of data parallelly
It is coded and released in Java
Hadoop core is divided into two fundamental layers:
MapReduce engine and
HDFS (Hadoop Distributed File System)
HDFS acts as a data storage manager
MapReduce engine is the computation engine running on top of HDFS
MapReduce engine also manages the data flow and control flow of MapReduce jobs
27
HADOOP
HDFS:
It is a distributed file system inspired by GFS that organizes files and stores their
data on a distributed computing system
It has a master/slave architecture containing a single master node (NameNode)
and a number of workers/slave nodes (DataNodes)
It splits the file into fixed-size blocks (e.g., 64 MB) and stores them on workers
(DataNodes)
NameNode maps blocks to DataNodes
NameNode also manages the file system’s metadata and namespace.
28
HADOOP
MapReduce Engine:
It also follows a master/slave architecture consisting of a single JobTracker as the
master and a number of TaskTrackers as the slaves (workers)
The JobTracker manages the MapReduce job over a cluster
The JobTracker also responsible for monitoring jobs and assigning tasks to
TaskTrackers
The TaskTracker manages the execution of the map and/or reduce tasks on a single
computation node in the cluster.
29
HADOOP
Architecture of MapReduce in Hadoop
30
HADOOP
Running a job in Hadoop:
Three components contribute in running a job in this system: a user node, a
JobTracker, and several TaskTrackers.
The data flow starts by calling the runJob(conf) function inside a user program
running on the user node,
The job is submitted from a user node to the JobTracker node
user node asks for a new job ID from the JobTracker and computes input file
splits.
user node copies some resources, such as the job’s JAR file, configuration file, and
computed input splits, to the JobTracker’s file system.
31
HADOOP
Running a job in Hadoop:
user node submits the job to the JobTracker by calling the submitJob() function
The JobTracker creates one map task for each computed input split
The JobTracker assigns the map tasks to the TaskTrackers.
The JobTracker also creates reduce tasks and assigns them to the TaskTrackers.
The execution starts inside the TaskTracker by copying the job JAR file to its file
system
Regular task running check is performed by receiving periodic heartbeat messages
to the JobTracker from the TaskTrackers.
32
HADOOP
Running a job in Hadoop
33
DRYAD
It is a runtime software environment developed by Microsoft for parallel and
distributed computing
It allows users to define custom data flows using directed acyclic graphs (DAGs),
unlike the fixed structure of MapReduce.
In DAG,Vertices represent computation engines, while edges are communication
channels
the two main components handling the control flow of Dryad are the job manager
and the name server.
34
DRYAD
The job manager builds, deploys, and schedules job
The name server provides information about available computing resources.
Data transfer is done via channels without involving the job manager
A processing daemon runs in each computing node that communicates with the job
manager
It uses 2D distributed pipes that enable large-scale parallel processing across multiple
nodes
It handles vertex failures by reassigning jobs and channel failures by recreating
communication links.
35
DRYAD
Dryad Framework
36
PROGRAMMING SUPPORT ON GCP
Service Category Core Service Function Practical Use Case
Virtual Machines running on Google's Running a web server that requires
Compute Compute Engine
high-performance fiber network. specific OS configurations.
World-wide, continuous object Hosting high-resolution images or
Storage Cloud Storage
storage for any data type. video files for a mobile app.
Managed relational database service
Storing structured user data like login
Database Cloud SQL for MySQL, PostgreSQL, and SQL
credentials or order history.
Server.
Connecting your virtual machines
Virtual Private Cloud A global, managed network for your
Networking across different global regions
(VPC) Google Cloud resources.
securely.
Build and deploy containerized apps Hosting a "pay-as-you-go" API that
Serverless Cloud Run
that scale automatically to zero. only costs money when used.
A serverless, highly scalable multi- Processing billions of rows of sensor
Data Analytics BigQuery
cloud data warehouse. data to find trends in real-time.
A unified platform to train, tune, and Building an image recognition tool or
AI & ML Vertex AI
deploy AI models (including Gemini). a custom language model.
37
PROGRAMMING SUPPORT ON AWS
Service Category Core Service Function Practical Use Case
Amazon EC2 (Elastic Hosting a web application or
Compute Provides resizable virtual servers.
Compute Cloud) running custom software.
Amazon S3 (Simple Storage Object storage built to store and Storing website images, videos,
Storage
Service) retrieve any amount of data. or system backups.
Managed service for relational Managing user profiles,
Amazon RDS (Relational
Database databases (MySQL, PostgreSQL, transaction logs, and structured
Database Service)
etc.). data.
Creating a secure, private
Amazon VPC (Virtual Private A logically isolated section of the
Networking network environment for your
Cloud) AWS network.
servers.
Speeding up the delivery of files
A fast Content Delivery Network
Content Delivery Amazon CloudFront to users globally via Edge
(CDN) service.
Locations.
Runs code in response to events Automatically resizing an image
Serverless AWS Lambda
without managing servers. as soon as it is uploaded to S3.
Giving a developer permission to
AWS IAM (Identity & Access Controls who can access which
Security access a database but not the
Management) AWS resources.
billing info. 38
PROGRAMMING SUPPORT ON AZURE
Service Category Core Service Function Practical Use Case
Scalable, on-demand Windows or Linux Deploying a legacy enterprise application
Compute Azure Virtual Machines
computing resources. that requires a specific OS.
Highly scalable object storage for Storing massive datasets for research,
Storage Azure Blob Storage
unstructured data. logs, or website media.
A fully managed Relational Database-as- Building a high-performance web app
Database Azure SQL Database
a-Service (DBaaS). with automatic scaling and patching.
Azure Virtual Network A private network that allows Azure Connecting a front-end web server to a
Networking
(VNet) resources to securely communicate. back-end database securely.
Event-driven, serverless compute Triggering a data cleanup script every
Serverless Azure Functions
platform. time a user deletes their account.
A cloud-based identity and access Managing "Single Sign-On" (SSO) so
Identity Microsoft Entra ID
management service. students can log in with one account.
Access to powerful AI models like GPT- Integrating a chatbot or text summarizer
AI & ML Azure OpenAI Service
4 via Azure. into a college portal.
39
CLOUD SOFTWARE ENVIRONMENTS
Eucalyptus:
It is an open-source software platform used to build private and hybrid cloud computing
environments
It operates as an IaaS, allowing organizations to pool compute, storage, and network resources
It is highly compatible with Amazon Web Services (AWS) APIs
It manages physical hardware and virtual machines through components:
Cloud Controller (CLC): The entry point for users and admins, handling authentication,
accounting, and resource quotas
Cluster & Node Controllers: Manage the scheduling, execution, and networking of virtual
machine instances on the physical servers
Storage Controller & Walrus: Provide block-level storage (similar to Amazon EBS) and
object storage (similar to Amazon S3), respectively
40
CLOUD SOFTWARE ENVIRONMENTS
Nimbus:
It is an open-source toolkit used to transform a cluster of servers into an IaaS cloud
designed to handle the complex, heavy-duty computational needs of researchers (such as
physics simulations or bioinformatics) rather than general enterprise web hosting
supports both the Amazon EC2 API and the WSRF (Web Services Resource Framework),
which is commonly used in grid computing
allows a user to deploy a whole cluster of pre-configured virtual machines, rather than
just launching single instances
primarily works with Xen and KVM to manage virtual machines
41
CLOUD SOFTWARE ENVIRONMENTS
OpenNebula:
A powerful, open-source platform used to build and manage enterprise-grade clouds and
virtualized data centers
Designed for managing heterogeneous infrastructures (KVM, VMware, Xen)
Simpler to install and maintain
Allows admins to plug in different storage and networking backends
Provides a highly intuitive web interface called Sunstone, which provides different views
for administrators and end-users
42
CLOUD SOFTWARE ENVIRONMENTS
OpenStack:
open-source framework for building and managing both private and public clouds
it is a collection of dozens of independent modules, that you can pick and choose which
modules to install
Provides vendor neutrality since it is managed by the Open Infrastructure Foundation
it is highly compatible with AWS
can manage thousands of physical servers across multiple geographic regions
43