Cloud Computing Session 7-8

28
Cloud Computing Session 7-8 Shreesh Vakil January 2014

Transcript of Cloud Computing Session 7-8

Cloud ComputingSession 7-8

Shreesh Vakil

January 2014

Cloud Computing Applications

• Cloud Computing Applications– Challenges– Existing cloud applications– New application opportunities

• Architectural Styles for Cloud Applications• Technology Review

– SOAP– CORBA– REST

• Implementing Workflows in Cloud Apps• The Zookeeper (Coordination model)• The MapReduce (Implementation of SPMD)

Cloud Application Challenges

• Tackle imbalances with respect to Computing Capacity, I/O Capacity and Network Capacity

• Challenges of Load Balancing

– Performance isolation is nearly impossible in a heavily loaded ‘real’ system

• Reliability and cost effectiveness

• Data storage and storage bandwidth

• Logging

Existing Cloud Applications

• Cloud Application Categories

– Processing Pipelines

– Batch processing systems

– Web Applications

Processing Pipelines

• Indexing – Eg. Google, Search Engines

• Data Mining– Categorized business directories

• Image / Video Processing– Conversion of images / videos from one format to

another– Encryption

• Document Processing– Conversion of documents from one format to another– Encryption

Batch processing systems

• Generation of daily, weekly, monthly and annual activity reports for organizations in retail, manufacturing and other economic sectors

• Processing, aggregation and summarizing daily transactions for financial institutions, insurance companies, and healthcare organizations

• Processing billing and/or payroll records• Management of software development (nightly

builds, updates of software repositories etc.)• Automatic testing / verification of software and

hardware

Web Applications

• CRM / SCM Systems

– salesforce.com, sugarcrm.com

• Promotional Web Sites

– High traffic for a short duration

• Data acquisition websites

– Tax returns filing web applications

– Admission process

Architectural Styles for Cloud Applications

• Most cloud apps are built around stateless servers

• Advantages of stateless servers– Simpler, robust and highly scalable

– Resilience to failures (load balancing)

• Technologies used– SOAP (Simple Object Access Protocol)

– CORBA (Common Object Request Broker)

– REST (Representational State Transfer)

SOAP - Specification

• SOAP can form the foundation layer of a web services protocol stack, providing a basic messaging framework upon which web services can be built

• The SOAP specification defines the messaging framework which consists of:

• The SOAP processing model defining the rules for processing a SOAP message

• The SOAP extensibility model defining the concepts of SOAP features and SOAP modules

• The SOAP underlying protocol binding framework describing the rules for defining a binding to an underlying protocol that can be used for exchanging SOAP messages between SOAP nodes

• The SOAP message construct defining the structure of a SOAP message

SOAP – Processing Model

• The SOAP processing model describes a distributed processing model, its participants,

the SOAP nodes, and how a SOAP receiver processes a SOAP message.

• The following SOAP nodes are defined:– SOAP sender A SOAP node that transmits a SOAP message.

– SOAP receiver A SOAP node that accepts a SOAP message.

– SOAP message path The set of SOAP nodes through which a single SOAP message passes. Initial SOAP sender (Originator) The SOAP sender that originates a SOAP message at the starting point of a SOAP message path.

– SOAP intermediary A SOAP intermediary is both a SOAP receiver and a SOAP sender and is targetable from within a SOAP message. It processes the SOAP header blocks targeted at it and acts to forward a SOAP message towards an ultimate SOAP receiver.

– Ultimate SOAP receiver The SOAP receiver that is a final destination of a SOAP message. It is responsible for processing the contents of the SOAP body and any SOAP header blocks targeted at it. In some circumstances, a SOAP message might not reach an ultimate SOAP receiver, for example because of a problem at a SOAP intermediary. An ultimate SOAP receiver cannot also be a SOAP intermediary for the same SOAP message.

SOAP – Message Structure

• SOAP message is an ordinary XML document– Envelope : Required

• Identifies the XML doc to be a SOAP message

– Header : Optional• Header Information

– Body : Required• Contains call and response information

– Fault : Optional• Info about errors that occurred while

processing the message

SOAP Message Example

POST /InStock HTTP/1.1

Host: www.example.org

Content-Type: application/soap+xml; charset=utf-8 Content-Length: 299

SOAPAction: "http://www.w3.org/2003/05/soap-envelope"

<!- ->

<?xml version="1.0"?>

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">

<soap:Header>

</soap:Header>

<soap:Body>

<m:GetStockPrice xmlns:m="http://www.example.org/stock">

<m:StockName>IBM</m:StockName>

</m:GetStockPrice>

</soap:Body>

</soap:Envelope>

SOAP – Pros and Cons

• Advantages

– Can use HTTP, SMTP as transport protocol

– Tunneling through HTTP makes SOAP work well with firewalls and proxies

• Disadvantages

– Standard implementations using SOAP/HTTP bindings use XML producing bigger message payloads than competing technologies like CORBA or ICE

CORBA

• CORBA enables software written in different languages and running on different computers to work with each other seamlessly.

• Implementation details from specific operating systems, programming languages, and hardware platforms are all removed from the responsibility of developers

CORBA infrastructure

• A language mapping requires the developer to create IDL code that represents the interfaces to his objects

• a CORBA implementation comes with a tool called an IDL compiler which converts the user's IDL code into some language-specific generated code

• A traditional compiler then compiles the generated code to create the linkable-object files for the application

CORBA - Features

• CORBA provides following features for managing distributed objects– Objects By Reference

• Method calls on reference result in subsequent calls to the ORB and blocking on the thread

– Data By Value (integers, double, structs, enum etc)• Ability for strong typing

– CORBA Component Model (CCM)• Provides a component container

• Provides services like notification, authentication, persistence and transaction

REST

• REST is an architectural style for designing networked applications

• It proposes an alternative to using complex mechanisms like CORBA, RPC or SOAP

• REST in most cases uses HTTP using all four CRUD operations

REST Architecture Components• Resources, which are identified by logical URLs. Both state and functionality are represented using

resources.– The logical URLs imply that the resources are universally addressable by other parts of the system.– Resources are the key element of a true RESTful design, as opposed to "methods" or "services" used in RPC

and SOAP Web Services, respectively. You do not issue a "getProductName" and then a "getProductPrice" RPC calls in REST; rather, you view the product data as a resource -- and this resource should contain all the required information (or links to it).

• A web of resources, meaning that a single resource should not be overwhelmingly large and contain too fine-grained details. Whenever relevant, a resource should contain links to additional information -- just as in web pages.

• The system has a client-server, but of course one component's server can be another component's client.

• There is no connection state; interaction is stateless (although the servers and resources can of course be stateful). Each new request should carry all the information required to complete it, and must not rely on previous interactions with the same client.

• Resources should be cachable whenever possible (with an expiration date/time). The protocol must allow the server to explicitly specify which resources may be cached, and for how long.– Since HTTP is universally used as the REST protocol, the HTTP cache-control headers are used for this

purpose.– Clients must respect the server's cache specification for each resource.

• Proxy servers can be used as part of the architecture, to improve performance and scalability. Any standard HTTP proxy can be used.

Implementing Workflows in Cloud Apps

• Several cloud applications require the completion of multiple interdependent tasks

• Such activities that an ensemble of tasks is known as Workflow

• Workflow models are abstractions of the most important properties of the entities participating in a workflow management system

Model of a Workflow Task• Name

– Unique identifier

• Description• Actions

– Modifications of the environment caused by the execution of the task

• Preconditions– Boolean expressions that must be true before actions can take place

• Postconditions– Boolean expressions that must be true after actions can take place

• Attributes– Type and quantity of resources, security requirements, reversibility

etc.

• Exceptions– Information about exceptions and how they should be handled

Workflow Engine Components• Workflow Editor

• Verification Engine

• Enactment Engine

Workflow Patterns• Sequence pattern

• AND Split Pattern

• Synchronization Pattern

Coordination : The Zookeeper

Coordination : The Zookeeper

• Zookeeper guarantees

– Atomicity

– Sequential Consistency

– Single System Image for Clients

– Persistence of Updates

– Reliability

Coordination : The Zookeeper

• Zookeeper API– create

• Add a node at the given location on the tree

– delete• Delete a node

– get data• Read data from the node

– set data• Write data to the node

– get children• Retrieve the list of the children of the node

– synch • Wait for the data to propogate

Map Reduce

Map Reduce

• An app starts – the master instance – M worker instances for Map phase – R worker instances for the Reduce phase

• Master partitions input data in M segments• Each Map instance reads it’s input and processes it• Processed results are stored on local disks where map instances run• When all Map instances are completed, Reduce instances read

results and merge the partial results• Final results are written to the shared storage server• Master instance monitors Map and Reduce instances and provides

fault tolerance against failure of map and reduce instances

Questions / Discussion