صفحه 1:
Cloud Computing
Lesson 2: Basic
Architecture
Course Module by David S Platt
Harvard University Extension
School
Lecture by Nilanjan Banerjee
صفحه 2:
OK, Cloud Sounds Good, Now What?
Continuing the electric power analogy,
how do we have to design our
software (motors and other
consumers of electricity) to run on
this nice cloud platform (power
generation and transmission
network) over which we, the
customers, have very little detailed
control (must use available voltages,
frequencies, etc.)?
صفحه 3:
Some Common Patterns in
Distributed Programming
صفحه 4:
Background Part 0:
Virtualization
You can’t physically touch the cloud
server machines. Hardware can and
frequently will change.
To avoid dependency on specific
hardware, you generally write your
server program to run on virtual
machines.
صفحه 5:
Background Part 0:
Virtualization Diagram
صفحه 6:
Background Part 1:
Abstraction
Objects used locally represent a
combination of code and data in the
classic OO sense of the term.
method,
method,, [ state |
صفحه 7:
Background Part 1, Abstraction
In remote access, Client machines generally
access servers through proxy objects, which
expose methods similar to local objects, bu
actually contain communication code that
makes a call to server and returns results.
Service
Client 1 pfinstane | Client 2
=
7سا
لما ا ست للا
2م
The proxy Looks like a local object, feels like a
local object, programmer likes to think of it as a
local object because that’s easy and familiar.
But it isn’t really a local object, and shouldn't
be treated as one, as it is above.
صفحه 8:
Background Part 2:
Statelessness
It is expensive and difficult to maintain the
connection from proxy to a specific server-side
object from one call to the next. For example, load
balancing is difficult, as is lifetime management.
So you generally want to design your objects so
that they don’t expect their internal state to be
maintained from one call to another. The proxy
often stays alive on the client side, but is
connected to a difference object instance on the
server side on its next call.
صفحه 9:
Background Part 2:
Client 2
Statelessness
Service
Client 1
صفحه 10:
Background Part 2:
Statelessness
The term statelessness does not mean
that no data is maintained from one
call to the next. It does mean that no
data is maintained in an individual
object instance. Whatever data is
maintained from one call to the next
is maintained in some sort of storage
system, so that the next object
instance can pick up where the first
left off.
صفحه 11:
Background Part 2:
Statelessness
t= Client 2
Object fetches previous
state from storage when
it is instantiated at the
start of a call. It stores
current state in storage
when it is deactivated at
the end of a call.
Service
Client 1
صفحه 12:
Background Part 3:
Chunkiness
Calls to local objects are very quick, call overhead is
low.
In distributed system, call overhead is very much larger.
Therefore, it is important to make fewer calls, with more
data in each call
Optimum level of chunkiness depends on application
and will require experimentation EARLY in design
process.
صفحه 13:
Background Part 4: Message Passing
If client has to wait for server to finish
processing, or even be alive at the same time
as the server, we can wait a long time to get
the job done
Often the client does best to leave a message
about a job it wants done, then harvest the
results later. Example: voice mail or text msgs
vs. direct conversation.
Different programming model: no immediate
output parameters. Output comes through
another msg (again, like voice mail).
صفحه 14:
Background Part 4: Message Passing
Client {nessaae} Message
حا Queue
Client {nessace) 55006
صفحه 15:
Cloud Architecture of
Different Vendors
صفحه 16:
Amazon Cloud Offering
Amazon Elastic Compute Cloud
You create Amazon Machine Images
(their VM) containing your choice of OS
(Linux or Windows)
You then run whatever programs you
want, such as IIS.
Additional services, such as storage or
payment processing, are available a la
carte
صفحه 17:
Google Cloud Offering
Stateless — Request/Response
URL Fetch
Mail Python/jJava __ Stdlib _
VM process
Images
Task Queues Stateful service
XMPP
Memcache Datastore Blobstore
Google Accounts
صفحه 18:
Google Cloud Offering
You write your app and plug it into Google
App Engine, which handles HTTP(S)
requests, nothing else. Think RPC: request
in, processing, response out. Works well
for the web and AJAX
App configuration is dead simple, no
performance tuning needed
Everything is built to scale. “Infinite”
number of apps, requests/sec, storage
capacity. APIs are simple, stupid
صفحه 19:
Azure Overview
صفحه 20:
Azure Overview
Application is the software built by the
programmer. It does something
useful for the user, who connects to it
via the Internet
Azure runs on multiple Windows PCs in
a data center. It is the layer that
provides system services to the
application. From the app’s point of
view, this is the operating system.
صفحه 21:
Inside the Azure Layer
صفحه 22:
Inside the Azure Layer
Compute service runs applications.
Storage service stores data in simple
blobs, tables, and queues. Relational
storage is available through SQL Azure
(next lecture)
Fabric is the control, management, and
monitoring service for Azure itself.
صفحه 23:
Inside the Compute Layer
Each compute instance (web role or worker
role) runs in its own virtual machine.
Your service agreement specifies the number
and size of VMs that you can run
Instanc ae) عو3:ه56 | ١/0 #رعهم
ع 512 68
4
Small 1.6GHz = 1.75 225 تس
Medium 2x1.6 55 490 -
GHz
Large 4x16 7 1000 High
GHz
صفحه 24:
Inside the Compute Layer
Each VM contains a single role
instance.
صفحه 25:
Web Roles
A Web role is a computing object
instance which is exposed to the
outside Internet.
It runs in a VM containing IIS 7.
Can communicate with the outside
world via ASP.NET, WCF, or any other
.NET technology that works with IIS.
صفحه 26:
Worker Roles
A Worker Role is a computing object
which is not exposed to the outside
Internet
It runs in a VM which does not contain
۱5۰
Conceptually similar to a background
processing job.
Worker roles may process requests
queued by Web roles, or they may
sift through large amounts of pre-
صفحه 27:
Agent
Each compute instance contains an
Agent which represents the
application’s connection to Azure.
Provides simple API that lets a
compute instance interact with the
Azure Fabric.
صفحه 28:
Usage Scenarios
صفحه 29:
Scalable Web Application
Many Web Roles to handle many users
Data stored in tables
Example: online multiplayer game
صفحه 30:
Pattern 1 EY Windows Azure
Highly scalable dynamic
HTML or RIA application
leveraging scalable Web Roles
cloud storage
ASP.NET
HTML or Silverlight
in the browser
Cs
صفحه 31:
Parallel Processing
Application
Many Worker Roles to process data
and perform calculations
Data stored as blobs
One Web Role for control.
Roles communicate with each other via
queues.
صفحه 32:
Pattern 2 EY Windows Azure
Highly scalable dynamic
HTML or RIA application
leveraging Azure
Queues to pass
messages toa
gee mend i processing
agent.
56۳۷۵
HTML or Silverlight
in the browser Backgroun
0
Processing
صفحه 33:
Demo
Thumbnail Application
From Azure SDK
صفحه 34:
Blob Container
1. User uploads -
pictures to Picture Blob 1 4. Worker creates
blobs AV [Picture Blob 2 TN blob, places in
container
ع Thumbnail
Web Role _ | Blob 1 Worker Role
سب ۳8| اب
Blob 2
0, 5 ۷۷۵۵ 7
role
displays Queue
thumbnail “Make TN for جر
s to user new blob 2” yo
2. Web role 3. Worker
puts msg in role fetches
queue msg
صفحه 35:
Credits
Slides 5-7, 9, 14, 18 and 19 contain
information from “Cloud Computing:
Software Engineering Fundamentals”, by J.
Heinzelreiter and W. Kurschl, Upper
Austria University of Applied Sciences
Slides 20 and 22, contain diagrams from
David Chappell’s white paper “Introducing
Windows Azure”,
http://go.microsoft.com/?linkid=9682907