“Try not. Do, or do not. There is no try.” - Yoda

Slides:



Advertisements
Similar presentations
1 Perspectives from Operating a Large Scale Website Dennis Lee VP Technical Operations, Marchex.
Advertisements

A Flexible Cloud-Computing Platform Focus on solving business problems
Hello i am so and so, title/role and a little background on myself (i.e. former microsoft employee or anything interesting) set context for what going.
Architecting to be Cloud Native On Windows Azure or Otherwise
Thanks to Microsoft Azure’s Scalability, BA Minds Delivers a Cost-Effective CRM Solution to Small and Medium-Sized Enterprises in Latin America MICROSOFT.
“Try not. Do, or do not. There is no try.” - Yoda
System Center 2012 R2 Overview
Intro to SharePoint 2013 Architecture Liam Cleary.
What’s New in Windows Azure A platform overview + how it can fit into my development shop today… New England Microsoft Dev Group 06-June-2013 (6:30-8:30.
Page 1 Ricardo Villalobos Windows Azure Architect Evangelist Microsoft Corporation Designing, Building, and Deploying Windows Azure applications.
Amazon RDS (MySQL and Oracle) and SQL Azure Emil Tabakov Telerik Software Academy academy.telerik.com.
Technical Architectures
Overview Of Microsoft New Technology ENTER. Processing....
INTRODUCTION TO CLOUD COMPUTING Cs 595 Lecture 5 2/11/2015.
Platform as a Service (PaaS)
Google AppEngine. Google App Engine enables you to build and host web apps on the same systems that power Google applications. App Engine offers fast.
Plan Introduction What is Cloud Computing?
VM Role (PaaS)Virtual Machine (IaaS) StorageNon-Persistent StoragePersistent Storage Easily add additional storage DeploymentBuild VHD offsite and upload.
Joan Wortman Architecting for the Cloud Bill Wilder An App in the Cloud is not a Cloud-Native App Boston Code Camp #19 08-Mar-2013 (2:50 – 4:00 PM EDT)
How WebMD Maintains Operational Flexibility with NoSQL Rajeev Borborah, Sr. Director, Engineering Matt Wilson – Director, Production Engineering – Consumer.
Cloud Computing. Cloud Computing Overview Course Content
A Brief Overview by Aditya Dutt March 18 th ’ Aditya Inc.
Cloud Computing for the Enterprise November 18th, This work is licensed under a Creative Commons.
Cloud Computing Saneel Bidaye uni-slb2181. What is Cloud Computing? Cloud Computing refers to both the applications delivered as services over the Internet.
Cloud computing is the use of computing resources (hardware and software) that are delivered as a service over the Internet. Cloud is the metaphor for.
Components of Windows Azure - more detail. Windows Azure Components Windows Azure PaaS ApplicationsWindows Azure Service Model Runtimes.NET 3.5/4, ASP.NET,
Introduction To Windows Azure Cloud
Training Workshop Windows Azure Platform. Presentation Outline (hidden slide): Technical Level: 200 Intended Audience: Developers Objectives (what do.
Migrating Business Apps to Windows Azure Marc Müller Principal Consultant, 4tecture GmbH
Cloud Computing. What is Cloud Computing? Cloud computing is a model for enabling convenient, on-demand network access to a shared pool of configurable.
Your First Azure Application Michael Stiefel Reliable Software, Inc.
Cloud Computing & Amazon Web Services – EC2 Arpita Patel Software Engineer.
Windows Azure Conference 2014 Deploy your Java workloads on Windows Azure.
Overview of Cloud Computing Sven Rosvall ACCU
Microsoft Azure SoftUni Team Technical Trainers Software University
Azure Best Practices How to Successfully Architect Windows Azure Apps for the Cloud 13-Mar-2013 (1:00 PM EDT) Bill Wilder An App in the Cloud is not (necessarily)
11 CLUSTERING AND AVAILABILITY Chapter 11. Chapter 11: CLUSTERING AND AVAILABILITY2 OVERVIEW  Describe the clustering capabilities of Microsoft Windows.
Windows Azure Virtual Machines Anton Boyko. A Continuous Offering From Private to Public Cloud.
Windows Azure. Azure Application platform for the public cloud. Windows Azure is an operating system You can: – build a web application that runs.
Text Microsoft to Or Tweet #uktechdays Questions?
 Mike Martin  Architect  MEET Member  Crew Member of Azug  Windows Azure Insider  Windows Azure MVP  
Windows Azure Web Sites Second-generation PaaS Boston Cloud Meetup 14-January-2014 (00:30) Boston Azure User Group
3/12/2013Computer Engg, IIT(BHU)1 CLOUD COMPUTING-1.
Web Technologies Lecture 13 Introduction to cloud computing.
Cloud Architecture Patterns for Mere Mortals New England Code Camp #16 29-October-2011 Copyright (c) 2011, Bill Wilder – Use allowed under Creative Commons.
Architecture Patterns for Building Cloud-Native Applications NYC Code Camp 7 15-September-2012 (10:45 – noon) Boston Azure User Group
Microsoft Cloud Computing. Topics to be covered 1.Environmental Features of windows azure 2.What is Cloud Computing 3.Roles in Cloud Computing 4.Benefits.
Hello Cloud… Mike Benkovich
Building Cloud Solutions Presenter Name Position or role Microsoft Azure.
(re)-Architecting cloud applications on the windows Azure platform CLAEYS Kurt Technology Solution Professional Microsoft EMEA.
Cloud Computing from a Developer’s Perspective Shlomo Swidler CTO & Founder mydrifts.com 25 January 2009.
Building web applications with the Windows Azure Platform Ido Flatow | Senior Architect | Sela | This session.
 Cloud Computing technology basics Platform Evolution Advantages  Microsoft Windows Azure technology basics Windows Azure – A Lap around the platform.
Amazon Web Services. Amazon Web Services (AWS) - robust, scalable and affordable infrastructure for cloud computing. This session is about:
Cloud-Native Architecture Patterns (Or… why your pre-cloud architecture won’t work so well in the cloud) Azure Florida Association 28-March-2012 Boston.
Platform as a Service (PaaS)
Boston Code Camp October-2012 (1:30 – 2:40)
Deploying Web Application
Platform as a Service (PaaS)
Platform as a Service (PaaS)
Logo here Module 3 Microsoft Azure Web App. Logo here Module Overview Introduction to App Service Overview of Web Apps Hosting Web Applications in Azure.
Architecture Patterns for Scalability & Reliability
Hello Farmington! 4:30-5:30, then dinner.
Windows Azure 講師: 李智樺, Ruddy Lee
Outline Virtualization Cloud Computing Microsoft Azure Platform
AWS Cloud Computing Masaki.
DevBoston 07-February-2013 (6:00 PM)
Developing for Windows Azure
5 Azure Services Every .NET Developer Needs to Know
Building global and highly-available services using Windows Azure
Presentation transcript:

“Try not. Do, or do not. There is no try.” - Yoda http://en.wikipedia.org/wiki/File:Yoda_Attack_of_the_Clones.png Yoda finally admits he does not understand exception handling...

Code Reuse: A practice in which other people get to use the code that I wrote. Code Reuse: when other people use code that I wrote.

“There are 2 hard problems in computer science: caching, naming things, and off-by-1 errors…” - (Source unknown)

Architecting to be Cloud Native                                          Aligning your application’s architecture with the architecture of the cloud… FTW! But the cloud is a friendly place for non-native apps too! HELLO my name is Bill Wilder 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. Guest lecture at Dino Konstantopoulos’ BU MET CS755 Cloud Computing class 17-April-2014 (7:00 – 9:00 PM EDT)

Bill Wilder HELLO my name is My name is Bill Wilder codingoutloud@gmail.com blog.codingoutloud.com @codingoutloud www.devpartners.com

Who is Bill Wilder? www.cloudarchitecturepatterns.com www.bostonazure.org www.devpartners.com

I will ass-u-me… You know what “the cloud” is You have an inkling about Amazon Web Services and Windows Azure cloud platforms You understand that such cloud platforms include compute services [like hosted virtual machines (VMs), in both IaaS and PaaS modes], SQL and NoSQL database services, file storage services, messaging, DNS, management, etc. You are interested in understanding cloud-native applications and why that’s better than deploying my old-school app to the cloud “as is”

Roadmap for rest of talk… … Lightning-fast overview of Windows Azure Cover three specific patterns for building cloud-native applications Mention some other patterns along the way Q&A during talk is okay (time permitting) Q&A at end with any remaining time Okay to reach out through email or twitter ?

General information Management Portal Windows Azure Portal http://www.windowsazure.com Management Portal http://manage.windowsazure.com

“Bring Your Own” ____ as a Service BYO Users BYO Applications BYO Virtual Machines SaaS  less Responsibility & Flexibility PaaS Most productive platforms for Cloud-Native Apps more NIST TERMINOLOGY Our concern: Custom Applications (which rules out SaaS), and constructed to be Cloud-Native  IaaS NIST: http://csrc.nist.gov/publications/nistpubs/800-145/SP800-145.pdf

NIST Terminology Power? Rigidity Simplicity SaaS = 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. Complexity Flexibility Power? http://csrc.nist.gov/publications/nistpubs/800-145/SP800-145.pdf

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: http://porkbrainsandmilkgravy.blogspot.com/2012/02/arg-arg-arg-arg-arg.html

Know the rules “If I had asked people what they wanted, they would have said faster horses.” - Henry Ford Faster horses would not have addressed the horse manure problem … late 1800s.. 150k horses in NYC x 20 lbs manure/day/horse = 3 million lbs of manure per day CNA is future (late 1800s) 150,000 horses in NYC each producing 15-30 lbs of manure per day = 3 million pounds of horse manure per day… http://www.uctc.net/access/30/Access%2030%20-%2002%20-%20Horse%20Power.pdf

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

Cloud Platform Characteristics Scaling – or “resource allocation” – is horizontal and ∞ (“illusion of infinite resources”) Resources are easily added or released self-service portal or API; cloud scaling is automatable Pay only for currently allocated resources costs are operational, granular, controllable, and transparent Optimized for cost-efficiency cloud services are MT, hardware is commodity MTTR over MTTF Rich, robust functionality is simply accessible like an iceberg

Cloud-Native Application Characteristics Application architecture is aligned with the cloud platform architecture uses the platform in the most natural way lets the platform do the heavy lifting

Cloud-Native Application Characteristics Cloud (Azure) ≠ hosting Don’t fight it! GO WITH THE FLOW Application architecture is aligned with the cloud platform architecture uses the platform in the most natural way lets the platform do the heavy lifting Image credit: http://www.flickr.com/photos/fabiogis50/3691085094/sizes/o/in/photostream/

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

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

 = SOA TTM & Sleeping well 1/9th above water According 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 CLOUD Photo credit: http://upload.wikimedia.org/wikipedia/commons/a/ac/Iceberg.jpg TTM & Sleeping well = SOA

MTBF MTTR Architectural Assumptions failure is routine (so you better be good at handling it) Photos from Bill Wilder cloud services are MT, hardware is commodity Cloud services CAN FAIL – you need to implement Busy Signal Pattern – and YOUR SERVICES CAN FAIL commodity hardware + multitenant services = cost-efficient cloud

“Try not. Do, or do not. There is no try.” - Yoda try { foo.ThisCanThrow(); } catch (Exception ex) { // … } Yoda not a good cloud developer would make http://en.wikipedia.org/wiki/File:Yoda_Attack_of_the_Clones.png

Eventually Consistent Loosely Coupled & Eventually Consistent http://thetrad.blogspot.com/2013/04/the-dude-in-68.html Data & Workflow Architecture

This bar is always open *and* has an API Photo from Bill Wilder Pay by the Drink $

∞ Resource Allocation Resource allocation (scaling) is: Horizontal Bi-directional Automatable The “illusion of infinite resources” Resource Allocation

Integrated Surface Area

? www.pageofphotos.com But… what’s WRONG with this architecture? Simple idea, simple app Two-tiers: web tier (one server) + database What’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. ?

www.pageofphotos.com Simple idea, simple app Two-tiers: web tier (one server) + database What can go wrong We’ll reexamine Scaling the web tier Scaling the service tier Scaling the data tier Handling failure Operational efficiency (scale the app, not the team!)

Horizontal Scaling Compute Pattern pattern 1 of 3

What’s the difference between performance and scale? SLA, practical reasons

Scale Up (and Scale Down??) vs. Horizontal Resourcing Common Terminology: Scaling Up/Down  Vertical Scaling Scaling Out/In  Horizontal “Scaling”  But really is Horizontal Resource Allocation Architectural Decision Big decision… hard to change

Vertical Scaling (“Scaling Up”) Resources that can be “Scaled Up” Memory: speed, amount CPU: speed, number of CPUs Disk: speed, size, multiple controllers Bandwidth: higher capacity pipe … and it sure is EASY . Downsides of Scaling Up Hard Upper Limit HIGH END HARDWARE  HIGH END CO$T Lower value than “commodity hardware” May have no other choice (architectural)

Scaling Horizontally: Adding Boxes Autonomous nodes for scalability (stateless web servers, shared nothing DBs, your custom code in QCW) Autonomous nodes *and* Homogeneous nodes for operational simplicity Anonymous nodes don‘t get emotionally involved! This is how the CLOUD works *and* This is how YOUR CLOUD-NATIVE APP WORKS

Example: Web Tier www.pageofphotos.com Managed VMs (Cloud Service) Architectural concerns N>1 N+1 Reactive Load Balancer (Cloud Service)

Horizontal Scaling Considerations Auto-Scale Bidirectional Nodes can fail Auto-Scale is only one cause Handle shutdown signals Stateless (“like a taxi”) vs. Sticky Sessions Stateless nodes vs. Stateless apps N+1 rule vs. occasional downtime (UX) Architectural concerns N>1 N+1 Reactive

? How many users does your cloud-native application need before it needs to be able to horizontally scale? SLA, practical reasons

Queue-Centric Workflow Pattern pattern 2 of 3 (QCW for short)

Extend www.pageofphotos.com example into Service Tier QCW enables applications where the UI and back-end services are Loosely Coupled (Compare to CQRS at end if there is interest)

QCW Example: User Uploads Photo www.pageofphotos.com Web Server Compute Service Reliable Queue AJAX – orthogonal concern Worker Role not related to HTML 5 concept of Web Worker Reliable Storage

QCW Compute (VM) resources to run our code WE NEED: Compute (VM) resources to run our code Reliable Queue to communicate Durable/Persistent Storage

Where does Windows Azure fit?

QCW [on Windows Azure] Compute (VM) resources to run our code WE NEED: Compute (VM) resources to run our code Web Roles (IIS) and Worker Roles (w/o IIS) Reliable Queue to communicate Azure Storage Queues Durable/Persistent Storage Azure Storage Blobs & Tables; WASD

QCW on Azure: User Uploads a Photo push pull Web Role (IIS) Worker Role Azure Queue www.pageofphotos.com AJAX – orthogonal concern Worker Role not related to HTML 5 concept of Web Worker “Thumbnails” sample code available from http://code.msdn.microsoft.com/windowsazuresamples Azure Blob UX implications: user does not wait for thumbnail (architecture!)

QCW enables Responsive UX Response to interactive users is as fast as a work request can be persisted Time consuming work done asynchronously Comparable total resource consumption, arguably better subjective UX UX challenge – how to express Async to users? Communicate Progress Display Final results Long Polling/Web Sockets (e.g., SignalR or Node.io)

QCW enables Scalable App Decoupled front/back provides insulation Blocking is Bane of Scalability Order processing partner doing maintenance Twitter down Email server unreachable Internet connectivity interruption Loosely coupled, concern-independent scaling (see next slide) Get Scale Units right Key to optimizing operational CO$T$

General Case: Many Roles, Many Queues Worker Role Web Role (Admin) Worker Role Worker Role Queue Type 1 Worker Role Type 1 Queue Type 1 Web Role (Public) Queue Type 2 Web Role (IIS) Queue Type 2 Worker Role Web Role (IIS) Worker Role Worker Role Worker Role Type 2 Queue Type 3 Worker Role Type 2 Worker Role Type 2 Worker Role Type 2 Scaling best when Investment α Benefit Optimize for CO$T EFFICIENCY Logical vs. Physical Architecture depends on current scale

Reliable Queue & 2-step Delete var url = “http://pageofphotos.blob.core.windows.net/up/<guid>.png”; queue.AddMessage( new CloudQueueMessage( url ) ); (IIS) Web Role Worker Role Queue AJAX – orthogonal concern Worker Role not related to HTML 5 concept of Web Worker var invisibilityWindow = TimeSpan.FromSeconds( 10 ); CloudQueueMessage msg = queue.GetMessage( invisibilityWindow ); (… do some processing then …) queue.DeleteMessage( msg );

QCW requires Idempotent Perform idempotent operation more than once, end result same as if we did it once Example with Thumbnailing (easy case) App-specific concerns dictate approaches Compensating action, Last write wins, etc. PARTNERSHIP: division of responsibility between cloud platform & app Far cry from database transaction

QCW expects Poison Messages A Poison Message cannot be processed Error condition for non-transient reason Use dequeue count property Be proactive Falling off the queue may kill your system Determine a Max Retry policy per queue Delete, put on “bad” queue, alert human, …

QCW requires “Plan for Failure” VM restarts will happen Hardware failure, O/S patching, crash (bug) Bake in handling of restarts into our apps Restarts are routine: system “just keeps working” Idempotent support needed important Event Sourcing (commonly seen with CQRS) may help Not an exception case! Expect it! Consider N+1 Rule Windows Azure: Fabric Controller honors Fault Domains

What’s Up? Reliability as EMERGENT PROPERTY Typical Site Any 1 Role Inst Overall System Operating System Upgrade Application Code Update Scale Up, Down, or In Hardware Failure Software Failure (Bug) Security Patch Tech Windows

Aside: Is QCW same as CQRS? Short answer: “no” CQRS Command Query Responsibility Segregation Commands change state Queries ask for current state Any operation is one or the other Sometimes includes Event Sourcing Sometimes modeled using Domain Driven Design (DDD)

What about the DATA? You: Azure Web Roles and Azure Worker Roles Taking user input, dispatching work, doing work Follow a decoupled queue-in-the-middle pattern Stateless compute nodes Cloud: “Hard Part”: persistent, scalable data Azure Queue & Blob Services Three copies of each byte Blobs are geo-replicated Busy Signal Pattern

Database Sharding Pattern pattern 3 of 3

Database Sharding Pattern Most Cloud Applications don’t care (much) about (very high) scale But they do care about developer productivity and operational efficiency pattern 3 of 3

Site-to-Site Virtual Network foo.com bar.com VNET in cloud, connected to on-prem foo.com as Azure Web Site running CMS bar.com as Azure Cloud Service Blob Storage Global CDN Blob Storage dedicated MySQL Database to run CMS Azure Cloud TDS (native SQL Server TCP-based wire protocol) SOAP / REST / HTTP Public Internet Site-to-Site Virtual Network Content Editing & Site Admin Dev Team Off-site/Travel Dev Team (Point-to-Site VPN from laptop to Azure) On-prem On-prem API Dev Team (Point-to-Site VPN from CoLo Router into Azure) On-prem database

Extend www.pageofphotos.com example into Data Tier What happens when demands on data tier grow? The Database Sharding Pattern – a little about reliability – a lot about scale and performance

Horizontal Scaling Everywhere Shard 3 Worker Role Worker Role Web Role (Admin) Worker Role Queue Type 1 Worker Role Type 1 Queue Type 1 Shard 2 Queue Type 2 Queue Type 2 Web Role (Public) Shard 1 Worker Role Web Role (IIS) Worker Role Web Role (IIS) Worker Role Worker Role Type 2 Queue Type 3 Worker Role Type 2 Worker Role Type 2 Worker Role Type 2

General Case: Many Roles, Many Queues Worker Role Web Role (Admin) Worker Role Worker Role Queue Type 1 Worker Role Type 1 Queue Type 1 Web Role (Public) Queue Type 2 Web Role (IIS) Queue Type 2 Worker Role Web Role (IIS) Worker Role Worker Role Worker Role Type 2 Queue Type 3 Worker Role Type 2 Worker Role Type 2 Worker Role Type 2 Scaling best when Investment α Benefit Optimize for CO$T EFFICIENCY Logical vs. Physical Architecture depends on current scale

Foursquare is a Social Network

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 Foursquare 32 employees (at the time) 10Gen Small company Microsoft BIG COMPANY (how many of the 90k employees work on SQL Server?) http://blog.foursquare.com/2010/10/05/so-that-was-a-bummer/ http://highscalability.com/blog/2010/10/15/troubles-with-sharding-what-can-we-learn-from-the-foursquare.html

What is Sharding? Problem: one database can’t handle all the data Too big, not performant, needs geo distribution, … Solution: split data across multiple databases One Logical Database, multiple Physical Databases Each Physical Database Node is a Shard Most scalable is Shared Nothing design May require some denormalization (duplication) [Not same as Data Warehouse or Reporting DB]

All shard have same schema SHARDS

Sharding is Difficult What defines a shard? (Where to put stuff?) Example – use country of origin: customer_us, customer_fr, customer_cn, customer_ie, … Use same approach to find records (can use lookup) What happens if a shard gets too big? Rebalancing shards can get complex Foursquare case study is interesting How to query / join / transact across shards Cache coherence, connection pool management Roll-your-own challenge

Where does Windows Azure fit?

Azure SQL Database (WASD) is SQL Server Except… SQL Server Specific (for now) SQL Database Specific Limitations 500 GB size limit Busy Signal Pattern Extra Capabilities Managed Service Highly Available Rental model Premium (reserved) Common Full Text Search Transparent Data Encryption (TDE) Many more… Limitations You need to run it Max VM size “Just change the connection string…” http://social.technet.microsoft.com/wiki/contents/articles/inside-sql-azure.aspx “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.” http://social.technet.microsoft.com/wiki/contents/articles/inside-sql-azure.aspx Additional information on Differences: http://msdn.microsoft.com/en-us/library/ff394115.aspx

Windows Azure SQL Databse Federations for Sharding Single “master” database “Query Fanout” makes partitions transparent Instead of customer_us, customer_fr, etc… we are back to customer database Handles redistributing shards Handles cache coherence Simplifies connection pooling No MERGE (yet); SPLIT only Bonus feature for Multitenant Applications USE FEDERATION myfed (myfedkey = 911) WITH FILTERING=ON RESET http://blogs.msdn.com/b/cbiyikoglu/archive/2011/01/18/sql-azure-federations-robust-connectivity-model-for-federated-data.aspx Greatest fear is Tenant Leakage

WHAT WENT WRONG? Foursquare #Fail Foursquare was implementing database sharding in the application layer. WASD Federations makes this unnecessary. WHAT WENT WRONG? Social Check-in Site Foursquare 32 employees (at the time) 10Gen Small company Microsoft BIG COMPANY (how many of the 90k employees work on SQL Server?) http://blog.foursquare.com/2010/10/05/so-that-was-a-bummer/ http://highscalability.com/blog/2010/10/15/troubles-with-sharding-what-can-we-learn-from-the-foursquare.html

? My database instance is limited to 500 GB. ∞ ∞ ∞ Does that mean the cloud doesn’t really offer the illusion of infinite resources?

Pre-Cloud vs. Cloud-Native Old-School vs. Cloud-Native Control Efficiency Stable/Static Hardware Dynamic/∞ Resources Fixed/CapEx Variable/OpEx Vertical Scaling Horizontal Resourcing Minimize MTBF Minimize MTTR Data Storage = RDBMS Scenario-specific Storage Manage Infrastructure Managed Infrastructure Pre-Cloud vs. Cloud-Native architectural concerns Not shown: Strong Consistency vs. Eventual Consistency MINDSET.. CHARACTERISTICS OF PRE-CLOUD vs. CLOUD-NATIVE Efficiency: electrical grid, virtual machine-based, multi-tenant, commodity hardware - 1:15k (vs. 1:30 or at best 1:150) Dynamic/∞ Resources: use cloud platform API to allocate or release resources; infinite resources available - but not all at once Variable/OpEx: stop using, stop paying; pay for expanded use Horizontal Resourcing: Similar to Scaling Out/Horizontal Scaling, except not just for scale… and bi-directional Minimize MTTR: Failure is expected, be prepared to deal with it; partnership between CLOUD PLATFORM and YOUR APPLICATION ARCHITECTURE Scenario-Specific Storage: Relational Database no longer one-size-fits-all. NoSQL, Blobs, CDN, Relational++ (auto-sharding) Managed Infrastructure: “ManageD” – the “D” on the end changes everything… Want a database? - available on demand, here’s a connection string. Want application services like a Reliable Queue? – here’s its http address, feel free to start using it. LB – ready. Geo-LB – ready (and you may deploy to >1 datacenter too – maybe MANY if you use CDN). These are REALLY IMPACTFUL DIFFERENCES and an application optimized to live in harmony with properities is CLOUD-NATIVE, and apps in harmony with the old properties is PRE-CLOUD

Pre-Cloud vs. Cloud-Native Lessons: being Cloud-Native 1:15,000 Efficiency Auto-Scaling via API Dynamic/∞ Resources Pay-As-You-Go Variable/OpEx Stateless, Autonomous Horizontal Resourcing N+1, Idempotent Minimize MTTR SQL, NoSQL, Blob Scenario-specific Storage VM, Storage, LB, DR Managed Infrastructure Pre-Cloud vs. Cloud-Native Not shown: Strong Consistency vs. Eventual Consistency MINDSET.. CHARACTERISTICS OF PRE-CLOUD vs. CLOUD-NATIVE Efficiency: electrical grid, virtual machine-based, multi-tenant, commodity hardware - 1:15k (vs. 1:30 or at best 1:150) Dynamic/∞ Resources: use cloud platform API to allocate or release resources; infinite resources available - but not all at once Variable/OpEx: stop using, stop paying; pay for expanded use Horizontal Resourcing: Similar to Scaling Out/Horizontal Scaling, except not just for scale… and bi-directional Minimize MTTR: Failure is expected, be prepared to deal with it; partnership between CLOUD PLATFORM and YOUR APPLICATION ARCHITECTURE Scenario-Specific Storage: Relational Database no longer one-size-fits-all. NoSQL, Blobs, CDN, Relational++ (auto-sharding) Managed Infrastructure: “ManageD” – the “D” on the end changes everything… Want a database? - available on demand, here’s a connection string. Want application services like a Reliable Queue? – here’s its http address, feel free to start using it. LB – ready. Geo-LB – ready (and you may deploy to >1 datacenter too – maybe MANY if you use CDN). These are REALLY IMPACTFUL DIFFERENCES and an application optimized to live in harmony with properities is CLOUD-NATIVE, and apps in harmony with the old properties is PRE-CLOUD

“Know the rules well, so you can break them effectively.” - Dalai Lama XIV

Integrated Surface Area

Practical Impact If 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 #

Cloud Architecture Patterns book Primer Chapters Scalability Eventual Consistency Multitenancy and Commodity Hardware Network Latency

Cloud Architecture Patterns book Pattern Chapters Horizontally Scaling Compute Pattern Queue-Centric Workflow Pattern Auto-Scaling Pattern MapReduce Pattern Database Sharding Pattern Busy Signal Pattern Node Failure Pattern Colocate Pattern Valet Key Pattern CDN Pattern Multisite Deployment Pattern

Questions? Comments? More information?

Business Card

BostonAzure.org Boston Azure cloud user group Focused on Microsoft’s Public Cloud Platform Monthly, 6:00-8:30 PM in Boston area Food; wifi; free; great topics; growing community Follow on Twitter: @bostonazure More info or to join our Meetup.com group: http://www.bostonazure.org

Find this slide deck here Contact Me Looking for … consulting help with Windows Azure Platform? someone to bounce Azure or cloud questions off? a speaker for your user group or company technology event? Just Ask! Bill Wilder @codingoutloud http://blog.codingoutloud.com community inquiries: codingoutloud@gmail.com business inquiries: www.devpartners.com book: www.cloudarchitecturepatterns.com Find this slide deck here

DONE

Subliminal … 0.25