ArchitecturalDesignPatternsinCloudComputingJineshVariaTechnologyEvangelistjvaria@amazon.comTheysentmeheretotalkButIamheretolistenPleaseSendFeedbackjvaria@amazon.comTwitter:@jinmanCloudBestPracticesWhitepaperPrescriptiveguidancetoCloudArchitectsJustGooglefor“CloudBestPractices”tofindthelinkAbstractResourcesFocusonyourneeds,notonhardwarespecs.Asyourneedschange,soshouldyourresources.On-DemandProvisioningAskforwhatyouneed,exactlywhenyouneedit.Getridofitwhenyoudon’tneedScalabilityScaleoutorindependingonusageneeds.NoUp-FrontCostsNocontractsorlong-termcommitments.Payonlyforwhatyouuse.EfficiencyofExpertsUtilizetheskills,knowledgeandresourcesofexperts.CloudComputingAttributesWhatmakestheCloudsoattractiveThe“LivingandEvolving”CloudTheCloudAWSservicesandfeaturesMostApplicationsNeed:1.Compute2.Storage3.Messaging4.Payment5.Distribution6.Scale7.Analytics»AmazonRDS»High-MemoryInstances»LowerEC2Pricing»AWSMulti-FactorAuthentication»VirtualPrivateCloud»LowerReservedInstancePricing»AWSSecurityCenter»ReservedInstancesinEURegion»ElasticMapReduce»SQSinEURegion»NewSimpleDBFeatures»FPSGeneralAvailability»LowerpricingtiersforAmazonCloudFront»AWSManagementConsole»AmazonEC2withWindows»AmazonEC2inEURegion»AWSToolkitforEclipse»AmazonEC2ReservedInstances»AWSImport/Export»NewCloudFrontFeature»Monitoring,AutoScaling&ElasticLoadBalancing»AmazonElasticMapReduceinEurope»EBSSharedSnapshots»SimpleDBinEURegion»Monitoring,AutoScaling&ElasticLoadBalancinginEU»AmazonCloudFrontPrivateContent»SAS70TypeIIAudit»AWSSDKfor.NET»AmazonEC2withWindowsServer2008,SpotInstances,BootfromAmazonEBS»AmazonCloudFrontStreaming»AmazonVPCentersUnlimitedBeta»AWSRegioninNorthernCalifornia»InternationalSupportforAWSImport/Export»AmazonEC2ReservedInstanceswithWindows,ExtraLargeHighMemoryInstances»AmazonS3VersioningFeature»ConsolidatedBillingforAWS»LowerpricingforOutboundDataTransferThe“LivingandEvolving”Cloud“AtAmazon,EveryDayisaLaunchDay”NewFeaturesandServicesScalabilityCharacteristicsofTrulyScalableServiceBuildScalableArchitectureonAWSAscalablearchitectureiscriticaltotakeadvantageofascalableinfrastructureIncreasingresourcesresultsinaproportionalincreaseinperformanceAscalableserviceiscapableofhandlingheterogeneityAscalableserviceisoperationallyefficientAscalableserviceisresilientAscalableservicebecomesmorecosteffectivewhenitgrowsCloudArchitectureLessons1.Designforfailureandnothingfails2.Loosecouplingsetsyoufree3.Implement“Elasticity”4.BuildSecurityineverylayer5.Don'tfearconstraints6.ThinkParallel7.LeveragedifferentstorageoptionsusingAmazonWebServices1.DesignforFailureEverythingfails,allthetimeWernerVogels,CTOAmazon.comandnothingwillreallyfailAvoidsinglepointsoffailureAssumeeverythingfails,anddesignbackwardsGoal:Applicationsshouldcontinuetofunctioneveniftheunderlyingphysicalhardwarefailsorisremovedorreplaced.DesignforFailurewithAWSToolstomakeyourlifeeasierUseElasticIPaddressesforconsistentandre-mappableroutesUsemultipleAmazonEC2AvailabilityZones(AZs)CreatemultipledatabaseslavesacrossAZsUsereal-timemonitoring(AmazonCloudWatch)UseAmazonElasticBlockStore(EBS)forpersistentfilesystemsEC2InstanceAEC2InstanceBYourWebTwoDotZeroName.comLOGVolumeDATAVolumeEC2InstanceAYourWebTwoDotZeroName.comLOGVolumeDATAVolumeEC2InstanceBAmazonS3AvailabilityZone1AvailabilityZone22.BuildLooselyCoupledSystemsThelooserthey'recoupled,thebiggertheyscaleIndependentcomponentsDesigneverythingasaBlackBoxDe-couplingforHybridmodelsLoad-balanceclustersControllerAControllerBControllerCControllerAControllerBControllerCQQQTightCouplingLooseCouplingusingQueuesUseAmazonSQSasBuffersMySQLMasterWebServerMyWebSite.comMySQL(Slave)AppServerAppServerLBWebServerLBAppserverTapesDataTierDatabaseServermachineswithmasterandlocalrunningseparately,NetworkstorageforStaticobjectsAppServerTierFleetofmachineshandlingApplicationspecificworkloadsCachingservermachinescanbeimplementedatthislayerAppLoadBalancerHardwareorSoftwaresolutiontospreadtrafficoverappserversWebTierFleetofmachineshandlingHTTPrequests.WebLoadBalancerHardwareorSoftwaresolutiontodistributetrafficoverwebserversExteriorFirewallHardwareorSoftwareSolutiontoopenstandardPorts(80,443)BackendFirewallLimitsaccesstoapplicationtierfromwebtierBackupsonTapesPeriodicbackupsstoredonTapesusuallymanagedby3rdpartyattheirsiteAvailabilityZone#nAvailabilityZone#1Auto-scalinggroup:AppTierAvailabilityZone2Auto-scalinggroup:WebTierAuto-scalinggroup:WebTierRDSMasterWebServerMyWebSite.comELB:WebTierAppServerCloudFrontLBWebServerSLBTomcatAppServerWebServerWebServerRDSSlaveAuto-scalinggroup:AppTierAppServerSLBTomcatAppServerRDSSlaveDNSAmazonS3DBTierMySQLRDSDBInstances(master,localslave,x-AZslaveforfailover),AutomatedbackupstoS3allmanagedbyAWSAuto-scalingAppTierGroupofEC2instancesrunningtheactualapp.InstancesbelongtoAuto-scalinggroup.CachingserversinstancescanbeimplementedatthislayerAppServerLoadBalancerSoftwareLB(e.g.HAProxy)onEC2instancetospreadtrafficoverappserverclusterAuto-scalingWebTierGroupofEC2instanceshandlingHTTPrequests.ElasticLoadBalancerELBtospreadtraffictoWebServerAuto-scalinggr