Web Service Programming and Cloud Computing 1 Bigger view of programming • What we learnt are mostly small, standalone programming tasks • In real world an application involves several tiers and languages – – – – – – RPC Client/server architecture Browser, http server Browser, http server, DB Browser, http server, application server, DB …… • Languages involved – Client side: Html, javascript, xml, css, xslt; – Server side: php, java, python, map/reduce, J2EE, sql, … 2 Web Service 3 Service Oriented Architecture Discovery agency publish find Requester interact Provider 4 A concrete SOA Registry Finds Service WSDL Describes Service Service Consumer SOAP Web Service Provider Communicates with XML Messages 5 Web Service definition • “encapsulated, loosely coupled, contracted software objects offered via standard protocols” --ZapThink Research – Encapsulated – Web Service implementation is invisible to entities outside the service – Exposes an interface but hides details – Loosely Coupled – Service and consumer software can be redesigned independently 6 History of Interface Definition Languages (IDLs) • IDL has a long history in distributed computing – – – – DCE (Distributed Computing Environment) CORBA IDL, OMG (Object Management Group) COM IDL, Microsoft WSDL • Traditional IDLs – Specifying what to call: the operation names, their signatures, exceptions. This is the job of IDL. – Agreeing on how to make an invocation: the mechanism of naming, activation, data encoding. This is what distributed standards such as CORBA or COM do. • WSDL needs to specify the both: the operation provided by the service, and the mechanism to access the service. 7 Web Service Description Language • WSDL defines – What the service is: the operations the service provides, including the signature of the operation –- what – Access specification: details of the data format and protocol necessary to access the service’s operation–- how – Location of the service: details of the network address, such as a URL –where 8 Legend: WSDL functionality view –What –how –where Interface Port Type Supports Formats & Protocols Binding Operation Input & Output How to encode Message Implements Port Provides Service Endpoints In WSDL 2.0, portType is changed to interface. 9 WSDL document structure view WSDL specification abstract part types messages operations port types concrete part bindings services and ports 10 <?xml version="1.0"?> <definitions name="Procurement" targetNamespace="http://example.com/procurement/definitions" xmlns:tns="http://example.com/procurement/definitions" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns="http://schemas.xmlsoap.org/wsdl/" > <message name="OrderMsg"> <part name="productName" type="xs:string"/> <part name="quantity" type="xs:integer"/> </message> <portType name="procurementPortType"> <operation name="orderGoods"> <input message = "OrderMsg"/> </operation> </portType> <binding name="ProcurementSoapBinding" type="tns:procurementPortType"> <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/> <operation name="orderGoods"> <soap:operation soapAction="http://example.com/orderGoods"/> <input> <soap:body use="literal"/> </input> <output> <soap:body use="literal"/> </output> </operation> </binding> <service name="ProcurementService"> <port name="ProcurementPort" binding="tns:ProcurementSoapBinding"> <soap:address location="http://example.com/procurement"/> </port> </service> </definitions> abstract part messages operation and port type concrete part binding port and service 11 <definitions … name="BNQuoteService"> <message name="getPriceRequest"> <part name="isbn" type="xsd:string"/> </message> <message name="getPriceResponse"><part name="return" type="xsd:float"/> </message> <portType name="BNQuotePortType"> <operation name="getPrice"> <input name="getPrice" message="tns:getPriceRequest"/> <output name="getPriceResponse" message="tns:getPriceResponse"/> </operation> </portType> <binding name="BNQuoteBinding" type="tns:BNQuotePortType"> <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/> <operation name="getPrice"><soap:operation/> <input><soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:xmethods-BNPriceCheck"/> </input> <output> <soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:xmethods-BNPriceCheck"/> </output> </operation> </binding> <service name="BNQuoteService"> <documentation>Returns price of a book at BN.com given an ISBN number</documentation> <port name="BNQuotePort" binding="tns:BNQuoteBinding"> <soap:address location="http://services.xmethods.net:80/soap/servlet/rpcrouter"/> </port> </service> </definitions> 12 Visual representation 13 Types (type information for the document, e.g., XML Schema) Message 1 Message 2 Message 3 Operation 1 Message 4 Operation 2 Message 5 Operation 3 Interface (abstract service) binding 1 binding 2 binding 3 binding 4 endpoint 1 endpoint 2 endpoint 3 endpoint 4 Service (the interface in all its available implementations) By Gustavo Alonso and Cesare Concrete description of the service WSDL document Abstract description of the service WSDL structure—interconnection view 14 A WSDL example <?xml version="1.0"?> <definitions name="PriceCheck" targetNamespace="http://www.skatestown.com/services/PriceCheck" xmlns:pc="http://www.skatestown.com/services/PriceCheck" xmlns:avail="http://www.skatestown.com/ns/availability" xmlns:wsi="http://ws-i.org/schemas/conformanceClaim/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns="http://schemas.xmlsoap.org/wsdl/"> <types> …</types> <message> …</message> <message> … </message> <portType> … </portType> <binding> … </binding> <service> … </service> </definitions> This example is from Steve Graham et al: Building Web Services with Java 15 PortType <portType name="PriceCheckPortType"> <operation name="checkPrice"> <input message="pc:PriceCheckRequest"/> <output message="pc:PriceCheckResponse"/> </operation> </portType> • <portType> defines the interface of web service. Just as Java Interface declaration; – Will change the name to <interface> in WSDL 2.0. • It consists of a sequence of operation declarations. • WSDL can have zero or more <portType>s. Typically just one. • It has a name attribute, must be unique. – The binding will refer the portType by its name 16 Operation • Operation defines a method signature; – Name, input, output, and fault • Input and output elements are associated with messages; • Different combinations of input/output define different operations types. <operation name="checkPrice"> <input message="pc:PriceCheckRequest"/> <output message="pc:PriceCheckResponse"/> </operation> 17 Operation Types • The request-response type is the most common operation type, but WSDL defines four types: – Request-response: The operation can receive a request and will return a response <operation name="checkPrice"> <input message="pc:PriceCheckRequest"/> <output message="pc:PriceCheckResponse"/> </operation> – One-way: The operation can receive a message but will not return a response. <operation name=“cancellation”> <input message=“tns:orderCancellation”/> </operation> – Notification:The operation can send a message but will not wait for a response <operation name=“notification”> <output message=“tns:promotionNotification”/> </operation> – Solicit-response:The operation can send a request and will wait for a response <operation name=“cancellation”> <output message=“tns:pushThis”/> <input message=“tns:reponseToPush”/> </operation> • Different types are decided by the order/occurrences of input and output. 18 Messages <message name="PriceCheckRequest"> <part name="sku" element="avail:sku"/> </message> <message name="PriceCheckResponse"> <part name="result" element="avail:StockAvailability"/> </message> • Describe the abstract form of input, output, or fault. • A WSDL file can have zero or more messages. • Each message has a name, which is unique within the document. • Each message has a collection of <part> elements. 19 Part <part name="sku" element="avail:sku"/> <part name="result" element="avail:StockAvailability"/> • A <part> element can be compared to a parameter in a method. • A part element has two properties: one is name, the other is its kind. • Kind can be a type or an element – Element refers to an element defined in XML Schema – Type refers to a simpleType or a complexType in XSD • In corresponding sku definition is: <xsd:element name="sku" type="xsd:string" /> 20 Types in WSDL <types> <xsd:schema targetNamespace="http://www.skatestown.com/ns/availability" > <xsd:element name="sku" type="xsd:string" /> <xsd:complexType name="availabilityType"> <xsd:sequence> <xsd:element ref="avail:sku"/> <xsd:element name="price" type="xsd:double"/> <xsd:element name="quantityAvailable" type="xsd:integer"/> </xsd:sequence> </xsd:complexType> <xsd:element name="StockAvailability" type="avail:availabilityType" /> </xsd:schema> </types> • The default type system is XML Schema; – Theoretically you can use any type system, such as Java types. • To be used in<part> element; • We can also import XML Schemas 21 SOAP request message <soapenv:Envelope xmlns:soapenv=“http://schema.xmlsoap.org/soap/evelope/” xmlns:xsd=“http://www.w3.org/2001/XMLSchema” xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance”> <soapenv:Body> <sku xmlns=“http://www.skatestown.com/ns/availability”>123</sku> </soapenv:Body> </soapenv:Envelope> • Relevant part of the WSDL file: <xsd:element name="sku" type="xsd:string" /> Envelope Header #0 Header #1 <message name="PriceCheckRequest"> <part name="sku" element="avail:sku"/> </message> <operation name="checkPrice"> <input message="pc:PriceCheckRequest"/> Body Message Payload <output message="pc:PriceCheckResponse"/> </operation> 22 SOAP response message <soapenv:Envelope xmlns:soapenv= … xmlns:xsd=… xmlns:xsi=… > <soapenv:Body> <StockAvailability xmlns= … > <sku> 123 </sku> <price xmlns=“”>100.00</price> <quantityAvailable xmlns=“”> 12 </quantityAvailable> </StockAvailability> </soapenv:Body> </soapenv:Envelope> • Relevant part of the WSDL file: <xsd:complexType name="availabilityType"> <xsd:sequence> <xsd:element ref="avail:sku"/> <xsd:element name="price" type="xsd:double"/> <xsd:element name="quantityAvailable" type="xsd:integer"/> </xsd:sequence> </xsd:complexType> <message name="PriceCheckResponse"> <part name="result" element="avail:StockAvailability"/> </message> <operation name="checkPrice"> <input message="pc:PriceCheckRequest"/> <output message="pc:PriceCheckResponse"/> </operation> 23 Binding <binding name="PriceCheckSOAPBinding" type="pc:PriceCheckPortType"> <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" /> <operation name="checkPrice"> <soap:operation soapAction = "http://www.skatestown.com/services/PriceCheck/checkPrice" /> <input> <soap:body use="literal" /> </input> <output> <soap:body use="literal" / </output> </operation> </binding> • Name of the binding should be unique; • Link to the portType is achieved by the portType name – This explains why portType name should be unique. • Typically, there is only one <binding> element; • Defines: – – – – Invocation style: rpc vs. document SOAPAction Input message appearance: literal or encoded Output message appearance 24 Service <service name="PriceCheck"> <port name="Pricecheck" binding="pc:PriceCheckSOAPBinding"> <documentation> <wsi:Claim conformsTo="http://ws-i.org/profiles/basic/1.0" /> </documentation> <soap:address location ="http://www.skatestown.com/services/PriceCheck"/> </port> </service> • Contains a set of <port> elements; • <port> combines the interface binding with a network address specified by a URI; • A web service can be available in different web addresses; 25 Tools • WSDL parser: WSDL4J • Apache Axis – – – – – Invoking SOAP web service; Translate WSDL to Java, and vice versa; Mapping Java into XML Schema, and vice versa; Host web service; API for manipulating SOAP; 26 Mapping between Java and WSDL in JAX-RPC • A simple example <message name="fooRequest"> <part name="para1" type="xs:string"/> </message> <message name="fooResponse"> <part name="para2" type="xs:float"/> </message> <portType name="FooBar"> <operation name="foo"> <input message="y:fooRequest"/> <output message="y:fooResponse"/> </operation> </portType> public interface FooBar extends java.rmi.Remote{ public float foo(java.lang.String para1) throws java.rmi.RemoteException; } 27 • Multiple input parameters <message name="fooRequest"> <part name="param1" type="xs:string"/> <part name="param2" type="xs:int"/> <part name="param3" type="xs:boolean"/> </message> <message name="fooResponse"> <part name="para2" type="xs:float"/> </message> <portType name="FooBar"> <operation name="foo"> <input message="y:fooRequest"/> <output message="y:fooResponse"/> </operation> </portType> public interface FooBar extends java.rmi.Remote{ public float foo(String param1, int param2, boolean param3) throws java.rmi.RemoteException; } 28 • Multiple output parameters <message name="fooRequest"> <part name="param1" type="xs:string"/> </message> <message name="fooResponse"> <part name="param2" type="xs:int"/> <part name="param3" type="xs:boolean"/> <part name="param4" type="xs:float"/> </message> <portType name="FooBar"> <operation name="foo"> <input message="y:fooRequest"/> <output message="y:fooResponse"/> </operation> </portType> public interface FooBar extends java.rmi.Remote{ public void foo(String param1, javax.xml.rpc.holders.IntHolder param2, javax.xml.rpc.holders.BooleanHolder param3, javax.xml.rpc.holders.FloatHolder param4, ) throws java.rmi.RemoteException; } 29 Mapping XML Schema to Java public class Address { private String street; private String city; public String getCity(){return city; } public void setCity(String c){city=c; } …… } <complexType name="Address"> <sequence> <element name="city" nillable="true" type="xsd:string"/> <element name="street" nillable="true" type="xsd:string"/> </sequence> </complexType> • Class has to have correct getters and setters; • In axis, you can use WSDL2Java and Java2WSDL to do the mapping. 30 03-60-440 Mashups 60-440 31 03-60-440 Mashups 60-440 32 Mashups • From Wikipedia Mashup – Mashup (music), a musical genre of songs that consist entirely of parts of other songs – Mashup (video), a video that is edited from more than one source to appear as one – Mashup (web application hybrid), a web application that combines data and/or functionality from more than one source • Combine data from multiple sources. – Mostly the data sources lay outside of the organizational boundaries • Create a new and distinct web service that was not originally provided by either source. • Content is typically sourced via a web API or a RSS Feed 60-440 33 Mashup example • The ChicagoCrime.org Web site Mashup – A mapping mashup – One of the first popular mashups – Mashes crime data from the Chicago Police Department’s online database with cartography from Google Maps – The concept and the presentation are simple and the composition of crime and map data is visually powerful 60-440 34 The following slides are borrowed from Umut Orhan Why mashup • Everybody needs customized applications, tailored to his/her own requirements, taste, style. • DIY in software/web application construction – There are many building blocks (web APIs, web services) – there are also some tools to assemble the building blocks • It is like end-user programming 60-440 35 Mashup flavours • Presentation mashups: e.g. Google Maps apps, with emphasis on presentation Mashup • This is the shallowest form of mashup in the sense that underlying data and functionality don’t meet. Information and layout is retrieved and either remix or just placed next to each other. Many of the Ajax desktops today fall into this category and so do portals and other presentation mashup techniques. • Data mashups: merging data from different sources • Business mashup: combination of above. combines data integration, presentation plus addition functionality, such as collaboration features 60-440 36 Map mashups • Locational information presented graphically using maps in a specified context Mashup Genres • Google Maps API opened the floodgates – mash all sort of data from nuclear disasters to Boston’s CowParade cows onto maps • Other APIs – Microsoft (Virtual Earth) – Yahoo (Yahoo Maps) – AOL (MapQuest) 60-440 37 Photo and Video • Photo/video hosting and social networking sites resulted interesting mashups. Mashup Genres – Flickr – YouTube – Facebook • Metadata associated with the hosted images and videos – – – – Who took the picture What it is a picture of Where and when it was taken So on… 60-440 38 Search and shopping • Exist long before the term Mashup was coined Mashup Genres – Combinations of B2B technologies or screen-scraping to aggregate comparative price data – eBay – Amazon – … 60-440 39 News • News sources such as BBC and Reuters have used syndication technologies like RSS and Atom since 2002. Mashup Genres • Personalized newspaper by Syndication feed mashups • Doggdot.us, combines feeds from the techie-oriented news sources Digg.com, Slashdot.org and Del.icio.us 60-440 40 Content provider • Web Protocols – REST Services – SOAP Web Services – RSS/Atom • Screen Scraping – Scraping is the process of using software tools to parse and analyze content that was originally written for human consumption in order to extract semantic data structures representative of that information that can be used and manipulated programmatically. 60-440 41 Mashup platforms Mashup platforms • IGoogle • Yahoo Pipes • Openkapow • IBM QedWiki • Microsoft popfly • Google Mashup Editor (migrated to Google App Engine) • …… 60-440 42 Yahoo! pipes Mashup platforms • Visual development environment for generating data-oriented mashups • Development is based on: – Dragging gadgets (pipes) from a toolbox and dropping them in work zone – Specifying data input – Interconnecting gadgets through pipes – Specifying data output format 60-440 43 Ajax • AJAX (Asynchronous JavaScript and XML) • Ajax and AJAX Web 2.0 • Characteristic: increased responsiveness and interactiveness of web pages – exchanging small amounts of data with the server – entire web page does not have to be reloaded each time the user performs an action. • Not a technology itself, but a term refer to the use of a group of technologies • The "core" and defining element of Ajax is the XMLHttpRequest object, which gives browsers the ability to make dynamic and asynchronous data requests without having to reload a page, eliminating the need for page refreshes. The following slides are from Jimmy Lin The iSchool University of Maryland 44 60-440 “Old-School” Web Applications server generates Web page as a response to the request browser sends request to server user does something 1 3 browser server-side systems Interface 2 HTTP request 5 HTTP response Web server backend database 4 browser replaces view with data sent from server 60-440 data is returned in response to the request 45 Characteristics • User-driven: Things only happen when the user does something (e.g., clicks on a link or button) • Views defined by URLs: You can bookmark something and come back to it; use the forward/backward button • Simple user interaction model: Not that many things you can do in browser • Synchronous Interaction: System responses are synchronized with user-driven events 60-440 46 Synchronous Interactions browser user activity user activity 1 user activity 5 2 Time 4 server-side 3 server processing 1 HTTP request browser 5 4 HTTP response 60-440 server processing 2 server-side systems 3 47 So what do you run on the server side? L A M P Linux Apache MySQL PHP/Python/Perl 60-440 48 From “Old-School” to Ajax Ajax intermediates between the interface and the server. browser server-side systems Interface request Ajax “engine” interaction management 60-440 response Web server backend database data management 49 Inside the Browser browser Rendering Engine Interface HTTP request HTML / CSS data other data (e.g. images) 60-440 HTTP response 50 Enter JavaScript Rendering Engine Interface browser HTTP request JavaScript Engine HTML / CSS data other data (e.g. images) 60-440 JavaScript code HTTP response 51 Enter Ajax HTTP request Rendering Engine Interface browser XMLHttpRequest HTTP request JavaScript Engine HTML / CSS data other data (e.g. images) 60-440 XML data JavaScript code HTTP response 52 From Synchronous Interactions… browser user activity user activity user activity Time server-side server processing 60-440 server processing 53 To asynchronous Interactions browser user activity client-side processing Time server-side server processing 60-440 server processing 54 Components of an Ajax Interaction 1. A client event occurs (captured by JavaScript event handlers) 2. An XMLHttpRequest object is created and configured 3. An asynchronous request is made to the server via the XMLHttpRequest object 4. Server processes request and returns data, executing a callback in the XMLHttpRequest object 5. The HTML DOM is updated based on response data 60-440 55 DOM • Document Object Model: platform- and language-independent way to represent XML – Adopts a tree-based representation – W3C standard, supported by modern browsers • JavaScript uses DOM to manipulate content – To process user events – To process server responses (via XMLHttpRequest) 60-440 56 Ajax: Things to watch out for! • Hype • Application development/maintenance cost – Brower incompatibilities – Many different approaches and tools – For many things, lack of agreed-on best practices • Behavior is not ‘Web-like’ – Standard things often don’t work correctly (e.g., browser ‘back’ button, bookmarks) – Usability issues for users with disabilities • Security issues 60-440 57 Cloud computing 58 What is cloud computing • Cloud – Datacenter hardware and software that the vendors use to offer the computing resources and services • Cloud computing – Refer to both the cloud and the services provided • Why called cloud computing – the computing happens out there "in the clouds” – wikipedia: "the term derives from the fact that most technology diagrams depict the Internet or IP availability by using a drawing of a cloud." 59 Definition of cloud computing • A large-scale distributed computing paradigm • Driven by economies of scale • Provider has a pool of abstracted, virtualized, dynamicallyscalable resources – Computing power, storage, platforms, and services • Delivered to customers on demand • 5 Characteristics (NIST 2009) – – – – – On demand self-service Broad network access Resource pooling Rapid elasticity Measured service 60 Timeline of cloud computing From Dr. Javier Soriano 61 Evolution of cloud computing 62 Economic reason for cloud computing 63 Challenge of cloud computing: Elasticity • Animoto.com: – Started with 50 servers on Amazon EC2 – Growth of 25,000 users/hour – Needed to scale to 3,500 servers in 2 days (RightScale@SantaBarbara) 64 RPC • In the early 1980’s, software was not yet “distributed”, only “copied around” • Programmers wanted to install software once on a server, and then call it remotely over a network from many clients • “Remote Procedure Call” (RPC) • Several major efforts were made to do RPC over the next 25 years • All suffered from at least one of the common “fallacies of distributed computing”: – The network is secure – The network is homogeneous – The network is fast enough • HTTP partially fulfilled the need in the early 1990’s – Programmers could make HTTP GET requests in those days, but the language support for it was not great until recent years 65 Early days of distributed computing • 1980’s: – RPC using C/C++ – EDI (Electronic Data Interchange) – Microsoft DCOM • 1990’s: – CORBA (for Unix/Linux only) – HTTP (so-called REST web services) • Still no way to distribute an application across multiple computers that was: – standards-based – platform-independent 66 SOA (Service Oriented Architecture) • They would be standards-based, platform-independent, and immune to firewalls – some kind of XML would be the wire format • Each service’s contract would be expressed in a formal manner and registered in a catalog – programming languages could “parse” this contract and utilize it at runtime, like an interface in Java – there would be a “factory” call that returned a reference to the currently preferred implementation of a given service contract – software architects would “compose” designs by shopping among available services • Network and machine speed and capacity would increase to make the overhead of XML tolerable – massive software reuse would be achieved 67 Another form of out sourcing • Differences – Scalability – ‘pay per use’, flexible arrangement 68 Three basic service models • Users: use software on thin clients. – Do not need to download and install the software – E.g. google doc, online tax • Developers: use some languages, APIs, servers to develop and deploy an application – Do not need a server to host the application • Network architect 69 Basic service models 70 Service Model Architectures Cloud Infrastructure Cloud Infrastructure Cloud Infrastructure IaaS PaaS PaaS SaaS SaaS SaaS Cloud Infrastructure Cloud Infrastructure IaaS PaaS Cloud Infrastructure IaaS PaaS Software as a Service (SaaS) Architectures Platform as a Service (PaaS) Architectures Infrastructure as a Service (IaaS) Architectures 71 Cloud Infrastructure as a Service (IaaS) • Also known as Hardware as a Service (HaaS). • Service provider owns the equipment; responsible for housing, running and maintaining it. • Client typically pays on a per-use basis, creates virtual machines (VMs) on demand – They have full access to these VMs • Strengths: – Can control and configure environment – Familiar technologies – Limited code lock-in • Weaknesses: – Must control and configure environment – Requires administrative skills to use • e.g. Amazon Web Service, Rackspace, GoGrid 72 73 PaaS • Platform provides hardware architecture and software framework (including application frameworks) • Developers provide an application, which the platform runs – They don’t work directly with VMs • Strengths: – Provides higher-level services than IaaS – Requires essentially no administrative skills • Weaknesses: – Allows less control of the environment – Can be harder to move existing software • e.g. Google App Engine, which supports Java and Python, and Engine Yard, which supports Ruby on Rails. 74 SaaS • Very common in the IT community • Software companies host their software themselves and then upgrade to maintain users • e.g. Salesforce.com –online CRM, Live.com, Zoho, Google Docs, Microsoft Web Apps 2010 75 Three Features of Mature SaaS Applications • Scalable – Handle growing amounts of work in a graceful manner • Multi-tenancy – One application instance may be serving hundreds of companies – Opposite of multi-instance where each customer is provisioned their own server running one instance • Metadata driven configurability – Instead of customizing the application for a customer (requiring code changes), one allows the user to configure the application through metadata 76 76 SaaS Maturity Levels • Level 1: Ad-Hoc/Custom • Level 2: Configurable • Level 3: Configurable, MultiTenant-Efficient • Level 4: Scalable, Configurable, Multi-TenantEfficient 77 Source: Microsoft MSDN Architecture Center77 Service Delivery Model Examples Amazon Google Microsoft Salesforce SaaS PaaS IaaS 78 Cloud Deployment Models • Private cloud – enterprise owned or leased • Community cloud – shared infrastructure for specific community • Public cloud – Sold to the public, mega-scale infrastructure • Hybrid cloud – composition of two or more clouds 79 Case studies 80 Google Cloud • Started with Google Apps • Platform as Service later on • Replace office software – – – – Gmail Google Docs (word processing and spreadsheets) Google video for business Google sites (intranet sites and wikis) • Google Cloud Connect • 500,000+ organizations use Google Apps • GE moved 400,000 desktops from Microsoft Office to Google Apps 81 Google App Engine • Exposes the Google Infrastructure to the outside world – BigTable – Python Language runtime – Access to some google api’s (authentication , image, manipulation) • APIs – – – – – – – – – Python Runtime, The Python environment in which your app runs; CGI, sandbox features, application caching, logging Datastore API, BigTable – Google’s Database Images API, the image data manipulation service Mail API, sending email from your app Memcache API, the distributed memory cache URL Fetch API, accessing other Internet hosts from your app Users API, integrating your app with Google Accounts You should expect to see more API’s exposed. More specifically the Google API’s for Docs , GWT , etc 82 Amazon Cloud • Amazon cloud components – Elastic Compute Cloud (EC2) – Simple Storage Service (S3) – SimpleDB 83 84 Amazon Cloud Users: New York Times and Nasdaq • Both companies used Amazon’s cloud offering • New York Times – Used EC2 and S3 to convert 15 million scanned news articles to PDF (4TB data) – Took 100 Linux computers 24 hours (would have taken months on NYT computers – “It was cheap experimentation, and the learning curve isn't steep.” – Derrick Gottfrid, Nasdaq • Nasdaq – Uses S3 to deliver historic stock and fund information – Millions of files showing price changes of entities over 10 minute segments – “The expenses of keeping all that data online [in Nasdaq servers] was too high.” – Claude Courbois, Nasdaq VP – Created lightweight Adobe AIR application to let users view data 85 Salesforce Cloud • Started with information management service that could replace traditional business software technology • Pioneered software-as-a-service market (esp. CRM tools) • 5,000+ Public Sector and Nonprofit Customers use Salesforce Cloud Computing Solutions • Moving beyond SaaS into the platform-as-a-service market 86 Salesforce.com in Government • President Obama’s Citizen’s Briefing Book – 134,077 Registered Users – 1.4 M Votes – 52,015 Ideas – Peak traffic of 149 hits per second • US Census Bureau Uses Salesforce.com Cloud Application – Project implemented in under 12 weeks – 2,500+ partnership agents use Salesforce.com for 2010 decennial census – Allows projects to scale from 200 to 2,000 users overnight to meet peak periods with no capital expenditure 87 Facebook’s Use of Open Source and Commodity Hardware • 400 million users + 250,000 new users per day • 100,000 transactions per second, 10,000+ servers • Built on open source software – Web and App tier: Apache, PHP, AJAX – Middleware tier: Memcached (Open source caching) – Data tier: MySQL (Open source DB) • Thousands of DB instances store data in distributed fashion (avoids collisions of many users accessing the same DB) 88 Drawbacks • Excessive dependence on the Internet • Subject to ISP and Cloud Service Providers’ disclosure policy • Inappropriate for sensitive, classified data • Data replication, coherency, integrity loss 89