4 NH Azure/.NET/Cloud Group 15-May-2013 (6:00 PM)How Architecting for the Cloud is Different Align your application’s architecture with the architecture of the cloud…HELLOmy name isBill WilderNH Azure/.NET/Cloud Group15-May-2013(6:00 PM)Abstract: If my application runs on cloud infrastructure, am I done? Not if you wish to truly take advantage of the cloud. The architecture of a cloud-native application is different than the architecture of a traditional application and this talk will explain why. How to scale? How do I overcome failure? How do I build a system that I can manage? And how can I do all this without a huge monthly bill from my cloud vendor? We will examine key architectural patterns that truly unlock cloud benefits. By the end of the talk you should appreciate how cloud architecture differs from what most of use have become accustomed to with traditional applications. You should also understand how to approach building self-healing distributed applications that automatically overcome hardware failures without downtime (really!), scale like crazy, and allow for flexible cost-optimization.Boston Azure User Group@bostonazureBill Wilder@codingoutloud

5 Bill Wilder HELLO my name is My name is Bill Wilderblog.codingoutloud.com@codingoutloud

8 Roadmap for rest of talk… …Lightning-fast overview of Windows AzureCover three specific patterns for building cloud-native applicationsMention some other patterns along the wayQ&A during talk is okay (time permitting)Q&A at end with any remaining timeOkay to reach out through or twitter?

10 NIST Terminology Power? Rigidity SimplicitySaaS = Software as a Service (BYO users)PaaS = Plaform as a Service (BYO apps)IaaS = Infrastructure as a Service (BYO VMs)Power depends on what you are trying to do. Context dependent. Not one-size fits all.ComplexityFlexibilityPower?

11 So Architecting for the (Windows Azure, AWS, GAE, …) Cloud is Different…WHY DID THEY (Microsoft, Amazon, Google, …) DO THIS TO US?But Why?Image credit:

12 Know the rules“If I had asked people what they wanted, they would have said faster horses.”- Henry FordFaster horses would not have addressed the horse manure problem… late 1800s k horses in NYC x 20 lbs manure/day/horse= 3 million lbs of manure per dayCNA is future(late 1800s) 150,000 horses in NYC each producing lbs of manure per day = 3 million pounds of horse manure per day…

13 Know the rules“If I had asked IT departments what they wanted, they would have said IaaS.”- Henry CloudCNA is future(late 1800s) 150,000 horses in NYC each producing lbs of manure per day = 3 million pounds of horse manure per day…

14 Cloud Platform CharacteristicsScaling – or “resource allocation” – is horizontaland ∞ (“illusion of infinite resources”)Resources are easily added or releasedself-service portal or API; cloud scaling is automatablePay only for currently allocated resourcescosts are operational, granular, controllable, and transparentOptimized for cost-efficiencycloud services are MT, hardware is commodityMTTR over MTTFRich, robust functionality is simply accessiblelike an iceberg

15 Cloud-Native Application CharacteristicsApplication architecture is aligned with the cloud platform architectureuses the platform in the most natural waylets the platform do the heavy lifting

16 Cloud-Native Application CharacteristicsCloud (Azure) ≠ hostingDon’t fight it!GO WITH THE FLOWApplication architecture is aligned with the cloud platform architectureuses the platform in the most natural waylets the platform do the heavy liftingImage credit:

17 The definition of “Cloud” is nebulous…The term “cloud” is nebulous…

19 What's different about the cloud?What is different about the cloud?public^^ public

20  = SOA TTM & Sleeping well 1/9th above waterAccording to wikipedia (http://en.wikipedia.org/wiki/Iceberg) “typically only one-ninth of the volume of an iceberg is above water”Iceberg comment not specific to CLOUD NATIVE – but just a reminder to the power of the CLOUDPhoto credit:TTM &Sleeping well=SOA

27 ? www.pageofphotos.com But… what’s WRONG with this architecture?Simple idea, simple appTwo-tiers: web tier (one server) + databaseWhat’s the problem?But… what’s WRONG with this architecture?Different ≠ WRONG. Use the right tool for the job. Some apps are simply not good fit for cloud.?

32 Vertical Scaling (“Scaling Up”)Resources that can be “Scaled Up”Memory: speed, amountCPU: speed, number of CPUsDisk: speed, size, multiple controllersBandwidth: higher capacity pipe… and it sure is EASY.Downsides of Scaling UpHard Upper LimitHIGH END HARDWARE  HIGH END CO$TLower value than “commodity hardware”May have no other choice (architectural)

44 QCW enables Responsive UXResponse to interactive users is as fast as a work request can be persistedTime consuming work done asynchronouslyComparable total resource consumption, arguably better subjective UXUX challenge – how to express Async to users?Communicate ProgressDisplay Final resultsLong Polling/Web Sockets (e.g., SignalR or Node.io)

48 QCW requires IdempotentPerform idempotent operation more than once, end result same as if we did it onceExample with Thumbnailing (easy case)App-specific concerns dictate approachesCompensating action, Last write wins, etc.PARTNERSHIP: division of responsibility between cloud platform & appFar cry from database transaction

52 Aside: Is QCW same as CQRS?Short answer: “no”CQRSCommand Query Responsibility SegregationCommands change stateQueries ask for current stateAny operation is one or the otherSometimes includes Event SourcingSometimes modeled using Domain Driven Design (DDD)

57 WHAT WENT WRONG? Foursquare #Fail October 4, 2010 – trouble begins…After 17 hours of downtime over two days…“Oct. 5 10:28 p.m.: Running on pizza and Red Bull. Another long night.”WHAT WENT WRONG?Social Check-in Site Foursquare32 employees (at the time)10GenSmall companyMicrosoftBIG COMPANY (how many of the 90k employees work on SQL Server?)

62 Windows Azure SQL Database (WASD) is SQL Server Except…SQL Server Specific(for now)WASDSpecificLimitations150 GB size limitBusy Signal PatternExtra CapabilitiesManaged ServiceHighly AvailableRental modelFederationsCommonFull Text SearchTransparent Data Encryption (TDE)Many more…“Just change the connection string…”“Another feature in development is the ability to take control of your backups. Currently, backups are performed in the data centers to protect your data against disk or system problems. However, there is no way currently to control your own backups to provide protection against logical errors and use a RESTORE operation to return to an earlier point in time when a backup was made. The new feature involves the ability to make your own backups of your SQL Azure databases to your own on-premises storage, and the ability to restore those backups either to an on-premises database or to a SQL Azure database. Eventually Microsoft plans to provide the ability to perform SQL Azure backups across data centers and also make log backups so that point-in-time recovery can be implemented.”Additional information on Differences:

64 WHAT WENT WRONG? Foursquare #FailFoursquare was implementing database sharding in the application layer.WASD Federations makes this unnecessary.WHAT WENT WRONG?Social Check-in Site Foursquare32 employees (at the time)10GenSmall companyMicrosoftBIG COMPANY (how many of the 90k employees work on SQL Server?)

70 Practical ImpactIf web tier going to cloud service (Web Role), ensure that session state is externalized (avoid keeping session state in local server memory)Ensure all logging done to durable location (since fail or scale event could make local hard drive go away) - often this is Windows Azure Diagnostic (WAD) Often pre-cloud apps have too much logic in the web tier (including spiky/memory intensive bits that drive web servers nuts) - some may belong in a service tier - separate "web tier" code from "business service" code - and bonus consideration is whether these tiers should communicate directly (REST or SOAP call) or over queue (Queue-Centric Workflow) Ensure Retry Logic and proper Exception Handling in place for all database access and network service access Will need to do a new sizing exercise based on new layout (which VM sizes for which tiers and how to scale) Licensing can be fun if using non-cloud-friendly licenses - esp if the most natural distributed architecture also unnaturally multiplies license costs Are there any non-standard configurations needed? Might indicate need for Startup Tasks Logging is often weak/lacking in pre-cloud apps - making harder to debug in distributed work once there's an issueBuild/deploy automation can often use some work. An auto-scale monitor (wasabi or one of the services) is usually new - so each app node needs to ensure it can close down gracefully since it may be scaled away (or failed away) If app is going to be updated in-place, the system needs to be able to support running mixed versions in the same cloud serviceUsing cloud services where operating system services were used -- for example, Blob Storage for durable file storage, a Caching Role or Table Storage for externalizing session state, media services if you are dealing with media, CDN, Traffic Manager, etc. If planning to use SQL Azure, dealing with sharding. Might mean schema changes, more so if using Federations than roll-your-own sharding.Use identity is one of the biggest cliffs to walk over - the first time you have an app in the cloud you are needing a way to authenticate - with WAAD and ADFS being a couple of them - this also obvious tends to involve company roles beyond that of a specific app dev team While we're on the topic of identity, modernizing to use Claims-based authorization is a big shift for some apps, but makes integrating with the cloud-native identity plumbing easierEvery node in a cloud service shares a public IP Address - so if they depend on having multiple IP Addresses (domains), they need to consider multiple cloud services or using just port #

About project

Feedback

To ensure the functioning of the site, we use cookies. We share information about your activities on the site with our partners and Google partners: social networks and companies engaged in advertising and web analytics. For more information, see the Privacy Policy and Google Privacy &amp Terms.
Your consent to our cookies if you continue to use this website.