Technical Report Cloud Architectural Pattern - Uni-stuttgart.de

Transcription

Universität StuttgartFakultät Informatik, Elektrotechnik undInformationstechnikA Collection of Patterns for Cloud Types, Cloud ServiceModels, and Cloud-based Application ArchitecturesChristoph Fehling1, Frank Leymann1, Ralph Mietzner1, Walter Schupeck2Report 2011/05Mai 10, 20111Institute of Architectureof Application SystemsUniversitätsstr. 3870569 StuttgartGermany2Daimler AGEpplestraße 22570546 StuttgartGermanyCR: C.0, C.2.4, D.2.2, D.2.3, D.2.7

Institute of Architecture of Application Systems (IAAS), Daimler AGReport 2011/05CaveatDescribing good solutions to reoccurring problems faced during the development of softwaresystems as patterns is a common practice in research and industry alike. While the development ofcloud applications faces many new challenges, existing patterns can be applied directly or can betransferred to the area of cloud computing with adjustments. This catalog therefore contains existingpatterns from the areas of standalone applications, grid applications, and message‐basedapplications. These patterns where transferred to the area of cloud computing focusing specificallyon this environment. They were compiled into the catalog using the same form as new patterns toincrease readability and accessibility. We do not claim to have invented these patterns. Referencesare given to the original sources in the respective sections of this document.Page 2 of 61

Report 2011/05Institute of Architecture of Application Systems (IAAS), Daimler AGDocument VersionsVersion1.0DateChangeInitial version of this document.IndexAbstract . 512Introduction . 51.1Pattern‐based Description for Cloud Computing . 61.2Document Structure . 61.3Visual Representations . 6Cloud Basics . 82.12.1.1Infrastructure as a Service (IaaS) . 92.1.2Platform as a Service (PaaS) . 102.1.3Software as a Service (SaaS) . 122.1.4Composite as a Service (CaaS) . 132.23Cloud Service Models . 8Cloud Types . 152.2.1Public Cloud . 152.2.2Private Cloud . 172.2.3Community Cloud . 182.2.4Hybrid Cloud . 20Cloud Service Types . 223.1Cloud Compute Services . 223.1.1Elastic Infrastructure . 223.1.2Low Availability Computing Node . 243.1.3High Availability Computing Node. 253.2Cloud Storage Services . 263.2.1Strict Consistency (Service Behavior) . 263.2.2Eventual Consistency (Service Behavior). 273.2.3Relational Data Store . 293.2.4Blob Storage . 303.2.5Block Storage . 31Page 3 of 61

Institute of Architecture of Application Systems (IAAS), Daimler AG3.2.63.34Report 2011/05NoSQL Storage . 32Communication Services . 333.3.1Message‐Oriented Middleware. 333.3.2Reliable Messaging . 353.3.3Exactly‐once delivery . 363.3.4At‐least‐once delivery . 37Cloud Application Architecture Patterns. 394.1Basic Architectural Patterns . 394.1.1Composite Application . 394.1.2Loose Coupling . 414.1.3Stateless Component . 424.1.4Idempotent Component . 434.2Elasticity Patterns . 454.2.1Map Reduce . 454.2.2Elastic Component . 464.2.3Elastic Load Balancer . 484.2.4Elastic Queue . 494.3Availability Patterns. 514.3.1Watchdog: High availability with unreliable Compute Nodes . 514.3.2Update Transition . 524.4Multi‐Tenancy Patterns . 544.4.1Single Instance Component . 544.4.2Single Configurable Instance Component . 554.4.3Multiple Instance Component . 565Acknowledgements . 586References . 58Page 4 of 61

Report 2011/05Institute of Architecture of Application Systems (IAAS), Daimler AGAbstractPatterns are a widely used concept in computer science to describe goodsolutions to reoccurring problems in an abstract form. Such conceptualsolutions can then be applied in concrete use cases regardless of usedtechnologies, such as software, middleware, or programming languages.As cloud computing is a new and developing field of commerce, newproducts and technologies are constantly made available to cloud users. Inthis scope, market dynamics often lead to confusing service descriptions.While advertising the individual properties of a specific cloud service mayhelp in positioning it on the competitive market of cloud computing, theyobfuscate the common underlying concepts. In this report, we thereforeemploy a pattern‐like description language to describe cloud service modelsand cloud types in an abstract form to categorize the offerings of cloudproviders. Further, we give reoccurring architectural patterns on how todesign, build, and manage applications that use these cloud services. Theabstracted form of these architectural patterns make them applicable tochallenges that developers of cloud application face today, independent ofthe actual technologies and cloud services that they are using.1IntroductionCloud computing drastically changes the way how IT resources, such as servers, applications, andstorage are accessed and used. Instead of providing these resources in dedicated and private datacenters, companies access them on‐demand over a network. Traditional APS providers or purevirtualization environments can be differentiated from clouds by three properties.Elasticity – resources in a cloud can be reserved and freed flexibly, often within minutes. This allowsthe actual number of such resources to be aligned tightly to the current demands of a company usingcloud technologies. Applications that experience a higher load during a certain time of the year, forexample, can request more resources only during these periods. Especially, for development and testpurposes, this property of clouds can make their use very profitable.Pay‐per‐use – no monthly charge for resource use is applied. Costs only arise for resources duringtheir usage times. Therefore, no long‐term upfront investments (CAPEX) in IT resources are requiredanymore. Instead, only the operational costs (OPEX) of these resources arise.Standardization – through the use of hardware virtualization and the resulting increase of image‐based system management standardizes the used hardware software stacks that are used in cloudapplications. Especially, differences between versatile hardware platforms are avoided, because ahomogeneous virtual hardware platform is provided on top of them. Virtual servers, used in cloudcomputing, can therefore often migrate between multiple physical hardware platforms easily, as longas the same virtualization environment can be provided.Page 5 of 61

Institute of Architecture of Application Systems (IAAS), Daimler AG1.1Report 2011/05Pattern‐based Descriptions of Cloud ComputingThe evolution of cloud computing has been mainly industry‐driven and remains at this stage today.Many new concepts and technologies are being developed rapidly and underlying concepts are oftenassumed implicitly. The introduction and use of cloud technologies in a company are often hinderedby these circumstances. We therefore introduce an abstract description of cloud service models,cloud types, types of the offerings provided in these clouds, and architectural patterns, describinghow applications are commonly built on top of clouds. Descriptions of these elements all show apattern‐based form. According to the pattern‐based description used in this report, each pattern isidentified by an icon and a question that motivate its use. Further, the context and challenges of thepattern are given to define the environment in which it is applicable. Then, a solution to thechallenges is described with help of a sketch depicting the fundamental components of the pattern.The solution is very brief and only states in short the actions that are taken to apply a pattern in thecontext. Detailed results are covered afterwards, followed by a list of other patterns related to it.This list is the main cause, why a pattern‐based form was also employed to describe the otheraspects of cloud computing, such as service models. For example, patterns may be only applicable ifa certain service model is used, thus, by using the same descriptive language these relations can beeasily expressed. After the description of relations to other patterns, the used pattern language givesvariations the current pattern. A variation is a small adjustment of the pattern or a minimal differentuse of it. It however is not significant enough to justify its descriptions as a new pattern. A patterndescription is finalized by giving real world examples where this pattern has been applied as well asfurther references relevant to the pattern. To increase the readability of this report, additional to acomplete list of references at the end of the document, references are also listed within each patterndescription.1.2Document StructureThe further structure of this document is as follows: Section 0 describes the basics of cloudcomputing comprised of the service models that are employed by the different types of clouds.Section 0 describes the abstracted types of services that are offered by clouds and their behavior.Computing services, communications services, and storage services are differentiated. Section 4then describes architectural patterns how applications can be built on top of these cloud servicetypes.1.3Visual RepresentationsThe icons for patterns as well as the sketches use several reoccurring graphical elements.IconDescriptionCompute Node – Resource that can be reserved by users of a cloud or that mayreside in a traditional static data center. This resource can be considered as a(virtual) server on which applications can be installed.Cloud – Used to depict a cloud computing environment that is offered todifferent customers and which may provide versatile resources. Generally, it isassumed that a cloud environment displays three characteristics: elasticity, pay‐per‐use, and standardization.Page 6 of 61

Report 2011/05IconInstitute of Architecture of Application Systems (IAAS), Daimler AGDescriptionCompany – Entity that uses IT resources and usually has a large number ofemployees associated with it that access these resources on behalf of thecompany. This icon is used to depict the affiliation of computing environments toa company.Access Control – This icon represents a component that handles userauthentication and authorization when they access a controlled environment.Platform – Services that are offered on top of compute nodes are referred to as aplatform. Again, applications may be executed using such a platform but a largerportion of application functionality and management functionality is provided bythe platform. In some cases the notion of (virtual) servers on which such aplatforms is based can be completely obfuscated.Database – Component that stores different forms of data that can be queriedand accessed by users. Capabilities of these queries and the type of accessesdiffer greatly depending on the type of the database.Data Elements – Entities that a user stores in a database. Different forms indicatedifferent information that given by the data elements.Globe – Used to depict the affiliation of computing environments to a generaluser group. These environments can therefore be considered to be accessible bya large number of individuals or companies.File – Element stored in a directory structure. It can be identified by a uniquename, which is also used to access it.Hard Drive – Entity that is accessed as a block storage device having a specificformatting. A hard drive can either be a physical drive or a file that is merelyaccessed similar to a physical hard drive.Database Tables – Tabular entries in a database that can be queried. A bar on thetop of these table elements is used to depict that the elements are structured.The lack of such a bar is used to depict that this structure is not existent or onlyvery weak.Message – A small amount of structures information exchanged bycommunication partners. Usually, this exchange is asynchronous.Message Cannel – Link between two or more communication partners by whichinformation (for example messages) are exchanged.Application Component – Entity that comprises a componentized application. Anapplication component offers a certain set of application functionality via a well‐defined interface to be used by other application components.Configuration – Parameters that specify how an application component shallbehave when accessed by a certain customer.Dashed Versions – Any element may also be depicted in a dashed form, which isused to express one of three conditions. (1) The element is added or removed.(2) The element is a virtual representation of its physical counterpart, that eitherprovides access to the physical counterpart or contains information how toinstantiates the physical counterpart.Page 7 of 61

Institute of Architecture of Application Systems (IAAS), Daimler AG2Report 2011/05Cloud BasicsIn the following it is described, how IT services are offered using cloud computing as well as thedifferent types of computing clouds and their specifics. The cloud service models and cloud typesdescribed here are conformant to the NIST definition of cloud computing [54].2.1Cloud Service ModelsCloud Service Models describe how different types of resources are offered as a service by the cloudprovider. Depending on the portion of the application stack that is controlled by the provider, onedifferentiates between Infrastructure, Platform, Software, or Composition as a Service (IaaS, PaaS,SaaS, CaaS respectively). This correlation between the software stack and the different “as a Service”models is also depicted in Figure 1.ProcessesCaaSSoftwareSaaSMiddlewarePaaSOperating SystemsVirtual ServersIaaSPhysical ServersFigure 1: Correlation between Application Stack Layersand the different Cloud Service ModelsEspecially, the following cloud service models may rely on other resources also offered as a service.This is often the case, because the desired cloud properties (elasticity, pay‐per‐use, andstandardization) of one service offering often require the same properties to be present in underlyingapplication layers. The dependencies of cloud service offerings are depicted in Figure 2.CaaSSaaSPaaSIaaSFigure 2: Possible Dependencies between Cloud Service ModelsPage 8 of 61

Report 2011/05Institute of Architecture of Application Systems (IAAS), Daimler AG2.1.1 Infrastructure as a Service (IaaS)How can IT‐infrastructure be offered dynamically over a network?ContextThe (virtual) servers of an elastic infrastructure (3.1.1) shall be offered to different users that areisolated from each other on a pay‐per‐use basis.ChallengesResources in an elastic infrastructure share common underlying resources such as networking,storage and optionally servers if virtual servers are provisioned on top of them. In such a settingdifferent users of the infrastructure must be isolated regarding data and performance. It thereforehas to be ensured that users cannot access other users’ data and that resource utilization of one userdoes not affect the performance of another user. Also, additional support systems are needed tomonitor the resource usage and bill them to customers accordingly.SolutionAccess control is added to an elastic infrastructure and the resource management is extended toisolate users from each other. The monitoring component collects additional information to supportpay‐per‐use ageDatabaseMonitoring(Virtual)Resource PoolResultsAccess controls authenticates users and control their usage of the API during the management of(virtual) server images and the starting and stopping of (virtual) servers. Further, the monitoringcomponent is extended to support billing based on accesses to the API as well as the amount of usedresources. The resource management now ensures that one user does not utilize that manyresources that it affects other users. Assured service levels are often expressed as a comparison totraditional systems, i.e. compute performance is said to be equivalent to a 1.6 GHz dual core CPU.Statements like this however have no indication how this performance is actually achieved.Page 9 of 61

Institute of Architecture of Application Systems (IAAS), Daimler AGReport 2011/05Additional requirements regarding the isolation of running (virtual) server relies on technologies usedin traditional server hosting environments, such as quotas for communication channel throughput.Relation to other PatternsHigher functionality that constitutes the application stack, such as middleware, software, orindividual composition of applications can also be offered as a service as described by the Platform(2.1.2), Software (2.1.3), and Composition as a Service (2.1.4) patterns respectively.Infrastructure as a Service may be part of the offerings that form a public (2.2.1), private (2.2.2), orhybrid cloud (2.2.4). In this case it is ensured that resources are available at virtually infinite numbers.VariationsTraditional dedicated server hosting could be compared to IaaS. However, it often lacks the dynamicpay‐per‐use billing model. Instead users pay monthly fees for servers. Similar billing models are alsointroduced to the IaaS market, so that users can decide between usage based pricing and a lowerprice if resources are reserved for longer time periods.Examples / ReferencesThe first and still the most dominant provider of IaaS is Amazon EC2 [3]. Virtual images can becreated based on pre‐configured images or through extraction from running systems. The API usedby Amazon to manage virtual machines has also been implemented by the open source Eucalyptusproject [29]. Recently, Microsoft also introduced a VM Role [57] to its Windows Azure cloud platformas an IaaS offering. However, the operating systems that a user can install on this particular a virtualmachine are limited to Windows versions, by the time of this writing.2.1.2 Platform as a Service (PaaS)How can IT platforms be offered dynamically over a network?ContextA middleware platform shall be offered to different users that are isolated from each other on a pay‐per‐use basis.ChallengesIn order to host the software components created by multiple users in a shared runtimeenvironment, that offers commonly used platform functionality, additional isolation of thesecomponents has to be insured. The platform itself therefore has to be made multi tenant‐aware, sothat software components cannot access data or functionality and do not influence the performanceof other users’ software components. Also, the platform needs to offer common services that can beused for communication between these components, data storage and the routing of accesses tocomponents. Elasticity of the hosted components shall also be enabled automatically.Page 10 of 61

Report 2011/05Institute of Architecture of Application Systems (IAAS), Daimler AGSolutionAn API allows users to deploy software components to a Platform as a Service offering, register andconfigure other platform services for communication e.g., message queues, storage e.g., blockstorage, and routing e.g., realized in an enterprise service DatabasePlatformServicesResultsAccesses to deployed software components and registered platform services are controlled to ensureisolation of users. The middleware components, such as applications servers, enterprise servicebusses, and messaging systems are extended to assure equivalent performance to all users. Softwarecomponents are often created using specific development environments or libraries to ensurecertain component properties, such as statelessness for example, to enable a platform controlledelasticity of deployed applications. Billing services, also offered by the platform, are often based onthe amount of storage used, number of messages sent, or accesses to the hosted services.Relation to other PatternsThe offered platform services follow cloud infrastructure patterns. Communication betweencomponents can be realized using messaging patterns (3.3) and storage using cloud storage patterns(3.2).Platform as a Service may be build upon an Infrastructure as a Service (2.1.1) to enable elasticity onthe underlying hardware on which the offered middleware services are hosted.To enable multi‐tenancy of the offered middleware components, such as applications services,messaging systems etc., they implement multi‐tenancy patterns. Platform as a Service may be part ofthe offerings that form a public (2.2.1), private (2.2.3), or hybrid cloud (2.2.4). In this case it isensured that resources are available at virtually infinite numbers.VariationsPaaS is often realized on top of IaaS by providing automated management of IaaS resources. Thissometimes leads to blurred boundaries between IaaS and PaaS, for example in Windows Azure (seebelow).Examples / ReferencesThe Google App Engine [35] and Salesforce’s Force.com [74] platform are pure PaaS offering wherethe user is unaware of the underlying infrastructure or its management. When using the WindowsAzure [63] PaaS offering, he is still aware of virtual machines, so called roles, on which his customPage 11 of 61

Institute of Architecture of Application Systems (IAAS), Daimler AGReport 2011/05developed application components are hosted. These virtual machines are however managed by theplatform regarding application update and patch management.Such an approach is taken to allow users of the platform to configure the level of automaticmanagement to their needs. Some application components can be hosted on platform managedvirtual servers, while others are managed manually. This is especially useful when existingapplications are moved to the cloud and it is unclear how they will react to automatic managementprocesses.2.1.3 Software as a Service (SaaS)xHow can software be offered dynamically over a network?ContextA software shall be offered to different users that are isolated from each other on a pay‐per‐usebasis.ChallengesIn order to allow multiple users to access software over a network it has to be ensured that each userperceives the software as if he was the only user. Since it is often unfeasible to provide an individualinstance of the software for every user, the software itself has to be made multi‐tenant aware. Thisway, its components, such as the user interface, business logic, and data storage can be shared bymultiple isolated users. Further, every user shall be enabled to configure the software to his needsregarding the location or content of menus in the user interface, for example, or the date andcurrency formats that shall be used.SolutionA user interface or an API is used to access the Software as a Service. Access is controlled to ensurethe isolation of multiple users while the desired customization is stored in a central database thatcontrols how shared components behave.SketchUI / ltsThe software is offered over a network using either a user interface or an API. In the former case, auser often accesses the software using a browser. In the latter case, the software providesPage 12 of 61

Report 2011/05Institute of Architecture of Application Systems (IAAS), Daimler AGfunctionality that is integrated with a user’s application that he runs on his own premise. Forexample, an external provider could offer communication services to send text messages or establishteleconferences. These services could then be integrated in a user developed calendar application.Access to the hosted software is controlled to avoid that users can access other users’ data orinfluence the performance that others experience. The customizations specified by users are storedin a database and are accessed from software components to determine their behavior.Relation to other PatternsSoftware as a Service may use underlying Platform (2.1.2) or Infrastructure as a Service (2.1.1)offerings to enable the desired elasticity. While this elasticity does not directly benefit the user of theSoftware as a Service offering, it allows the provider to scale the offered software dynamically withchanging user demands. This is a very important aspect in the Software as a Service market, since thesoftware offered often targets a large number of customers to leverage economies of scale.The components out of which the offered software is comprised can be implemented accordingly tomulti‐tenancy patterns (4.4) to ensure the required multi‐tenant awareness.Software as a Service may be part of the offerings that form a public (2.2.1), private (2.2.3), or hybridcloud (2.2.4). In this case it is ensured that resources are available at virtually infinite numbers.VariationsThe concept of offering software over a network is known for a very long time as application serviceproviders (ASP). However, in the past it has been realized mainly in a st

cloud types, types of the offerings provided in these clouds, and architectural patterns, describing how applications are commonly built on top of clouds. Descriptions of these elements all show a