SlideShare a Scribd company logo
Windows Azure: Cloud service development best practices 	Sriram Krishnan 	Program Manager 	Microsoft Corporation        sriramk@microsoft.com
				1980
void quicksort(int* array, int left, int right) { if(left >= right) return; int index = partition(array, left, right); quicksort(array, left, index - 1); quicksort(array, index + 1, right); }
				simplicity
Act I Architecture
Networks are unreliable
Hardware fails
A few design choices
Big, reliable, expensive machine
Several commodity machines
Lots and lots of commodity machines
A few challenges
What do you do about that pesky thing called state?
Go horizontal Go stateless
Store state in Windows Azure storage
And it is the default out of the box!
Session state provider <system.web>... 	<sessionStatemode="Custom"customProvider="TableStorageSessionStateProvider">             <providers>                 <addname="TableStorageSessionStateProvider“        		type="Microsoft.Samples.ServiceHosting.AspProviders.TableStorageSessionStateProvider"                       applicationName=“Foo” />             </providers> 	</sessionState> </system.web>
How do you deal with unreliable components?
Be loosely coupled
Use Windows Azure queues for separation of work
Default.aspx(Input + Making Coffee) LB
Tight coupling : Default.aspx.cs publicpartialclass_Default : System.Web.UI.Page     {                   protectedvoid Button1_Click(objectsender,EventArgs e)         {             var order = txtOrder.Text;             ProcessOrder(order);         } 	 protectedvoidProcessOrder(string order)         {  		//Make some coffee! ...         }      }
LB Default.aspx(Input) Worker.cs(Make Coffee) Windows Azure Queues
Loose coupling : Default.aspx.cs publicpartialclass_Default : System.Web.UI.Page     {                   protectedvoid Button1_Click(objectsender,EventArgs e)         {             var order = txtOrder.Text;             QueueStorageqStore = QueueStorage.Create(_account);             MessageQueueorderQ = qStore.GetQueue("OrderQueue");             orderQ.PutMessage(newMessage(order));        	 }      }
Loose coupling : WorkerRole.cs public class WorkerRole : RoleEntryPoint     {         public override void Start()         {             QueueStorageqStore = QueueStorage.Create(_account);             MessageQueueorderQ = qStore.GetQueue("OrderQueue");             while (true)             {                Message msg=orderQ.GetMessage(); if( msg != null)                 	ProcessOrder(msg.ContentAsString());             }         }                 protected void ProcessOrder(string order)         { //Make some coffee! ...         }
How do you deal with varying load?
Build a thermostat for your service
How do you deal with failures?
Use Windows Azure storage for valuable data
Be prepared to reconstruct local state…
…since it can disappear any time
Retry on transient failuresBut…
Be idempotent
Don’t launch a DoS attack on yourself
Be predictable
Avoid shutdown code
Know when to throttle and shed load
 Case study: SmugMug and SkyNet
 When is ‘good enough’ good enough?
The resiliency of email
 Do all apps need the same guarantees?
It's a knob
Stateless front-ends Loose coupling Building a thermostat Retrying on failures Loosening consistency Recap
End of Act I
Act II Updates
Updates are hard
Hard to ‘undo’ a failed deployment
Need to deal with both code and schema changes
Code + data Update only one at a time
Code vN Data vN
Code vN +1  Data vN Code vN
Data vN+1 Code vN Data vN
Be compatible
If it looks like a duck and walks like a duck… http://www.flickr.com/photos/gaetanlee/298160415/
Use version numbers in schema
                                    } Schema without versioning   classEmployee : TableStorageEntity     {        public Employee(stringfirstName, stringlastName) :             base(firstName, lastName) //partition key, row key         {}           publicstringJobTitle         {              get;              set;          }       }  ...        varqResult = fromempin svc.CreateQuery<Employee>(EmployeeDataServiceContext.EmployeeTable)        whereemp.PartitionKey == "Steve" && emp.RowKey == "Marx                selectemp;
                                    } Schema *with* versioning   classEmployee : TableStorageEntity     {        public Employee(stringfirstName, stringlastName) :             base(firstName, lastName)         {}           publicstringJobTitle         {              get; set;          }         publicint Version         {             get; set;         }      }  ...        varqResult = fromempin svc.CreateQuery<Employee>(EmployeeDataServiceContext.EmployeeTable)        whereemp.PartitionKey == "Steve" && emp.RowKey == "Marx   	 && emp.Version == 1               selectemp;
How do you do upgrades without downtime?
Windows Azure’s rolling upgrades
Stage Deployment Production Deployment Swap for zero downtime upgrade
+ Stop + start for big changes or if downtime isn’t an issue
Future: Precise control
When is the best time to update a service?
Use the Pacific Ocean
 Case study: Windows Live ID
Update code or data Maintain compat Versioning in schemas Rolling upgrades Recap
End of Act II
 December 4th, 1996
Oh Oh!
Trace logs
Trickiest patch ever
Act III When things go wrong…
How do I debug?
Use the Windows Azure SDK and debug locally to find bugs
Separate code and config
            Configuration files   ServiceDefinition.csdef <ServiceDefinitionname="DemoService">   <WebRolename="WebRole">       <ConfigurationSettings>       <Setting name="Color"/>     </ConfigurationSettings>   </WebRole> </ServiceDefinition> ServiceConfiguration.cscfg <ServiceConfigurationserviceName="DemoService">   <Rolename="WebRole">     <ConfigurationSettings>       <Setting name ="Color" value ="Red"/>     </ConfigurationSettings>   </Role> </ServiceConfiguration>
Windows Azure’s configuration update mechanism
How do I debug the cloud?
Logging
            Configurable logging   <?xmlversion="1.0"?> <ServiceConfigurationserviceName=“DemoService”>   <Rolename="WebRole">     <Instancescount="1"/>     <ConfigurationSettings>       <Settingname ="LogLevel"value ="Verbose"/>     </ConfigurationSettings>   </Role> </ServiceConfiguration> ... if (RoleManager.GetConfigurationSetting("LogLevel") == "Verbose")        RoleManager.WriteToLog("Information", "Some log message");
{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX} Tag data with unique ID to track across the system
How do I get notified when something bad happens?
! Windows Azure’s alerts
! Email / IM / Phone
The Big Red Button
Use the SDK Separate code and config Configurable logging Alerts The Big Red Button Recap
End of Act III
Credits & Acknowledgements  James Hamilton http://research.microsoft.com/~jamesrh/ Emre Kicimanhttp://research.microsoft.com/~emrek/ Pat Hellandhttp://blogs.msdn.com/pathelland/ What really happened on Mars http://research.microsoft.com/~mbj/mars_pathfinder/ Flickr blog post http://code.flickr.com/blog/2008/09/26/flickr-engineers-do-it-offline/ Don MacAskillhttp://blogs.smugmug.com/don/
One final story
    William of Ockhamc. 1288 - c. 1348
Numquamponendaestpluralitas sine necessitate Plurality ought never be posited without necessity
KISS
simplicity
sriramk@microsoft.comwww.sriramkrishnan.com
© 2008 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation.  Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation.   MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

More Related Content

What's hot

ASP.NET AJAX with Visual Studio 2008
ASP.NET AJAX with Visual Studio 2008ASP.NET AJAX with Visual Studio 2008
ASP.NET AJAX with Visual Studio 2008
Caleb Jenkins
 
Preparing your web services for Android and your Android app for web services...
Preparing your web services for Android and your Android app for web services...Preparing your web services for Android and your Android app for web services...
Preparing your web services for Android and your Android app for web services...
Droidcon Eastern Europe
 
Common mistakes in serverless adoption
Common mistakes in serverless adoptionCommon mistakes in serverless adoption
Common mistakes in serverless adoption
Yan Cui
 
Akka for realtime multiplayer mobile games
Akka for realtime multiplayer mobile gamesAkka for realtime multiplayer mobile games
Akka for realtime multiplayer mobile games
Yan Cui
 
improve website performance
improve website performanceimprove website performance
improve website performance
amit Sinha
 
Apex code Benchmarking
Apex code BenchmarkingApex code Benchmarking
Apex code Benchmarking
Amit Chaudhary
 
Web performance testing
Web performance testingWeb performance testing
Web performance testing
Patrick Meenan
 
10 practices that every developer needs to start right now
10 practices that every developer needs to start right now10 practices that every developer needs to start right now
10 practices that every developer needs to start right now
Caleb Jenkins
 
Serverless a superpower for frontend developers
Serverless a superpower for frontend developersServerless a superpower for frontend developers
Serverless a superpower for frontend developers
Yan Cui
 
Introduction to KSS
Introduction to KSSIntroduction to KSS
Introduction to KSS
Quintagroup
 
Building Single Page Apps with React.JS
Building Single Page Apps with React.JSBuilding Single Page Apps with React.JS
Building Single Page Apps with React.JSVagmi Mudumbai
 
Meetup React Sanca - 29/11/18 - React Testing
Meetup React Sanca - 29/11/18 - React TestingMeetup React Sanca - 29/11/18 - React Testing
Meetup React Sanca - 29/11/18 - React Testing
Augusto Lazaro
 
Angular vs React: Building modern SharePoint interfaces with SPFx
Angular vs React: Building modern SharePoint interfaces with SPFxAngular vs React: Building modern SharePoint interfaces with SPFx
Angular vs React: Building modern SharePoint interfaces with SPFx
Dimcho Tsanov
 
Asp.Net MVC Intro
Asp.Net MVC IntroAsp.Net MVC Intro
Asp.Net MVC Intro
Stefano Paluello
 
WordPress and Client Side Web Applications WCTO
WordPress and Client Side Web Applications WCTOWordPress and Client Side Web Applications WCTO
WordPress and Client Side Web Applications WCTO
Roy Sivan
 
Slideshare - Magento Imagine - Do You Queue
Slideshare - Magento Imagine - Do You QueueSlideshare - Magento Imagine - Do You Queue
Slideshare - Magento Imagine - Do You Queue10n Software, LLC
 
ESNext, service workers, and the future of the web
ESNext, service workers, and the future of the webESNext, service workers, and the future of the web
ESNext, service workers, and the future of the web
Jemuel Young
 
It's just Angular
It's just AngularIt's just Angular
It's just Angular
Vinci Rufus
 
Vaugham Hong - Embedding JavaScript V8
Vaugham Hong - Embedding JavaScript V8Vaugham Hong - Embedding JavaScript V8
Vaugham Hong - Embedding JavaScript V8
Allen Pike
 

What's hot (20)

ASP.NET AJAX with Visual Studio 2008
ASP.NET AJAX with Visual Studio 2008ASP.NET AJAX with Visual Studio 2008
ASP.NET AJAX with Visual Studio 2008
 
Preparing your web services for Android and your Android app for web services...
Preparing your web services for Android and your Android app for web services...Preparing your web services for Android and your Android app for web services...
Preparing your web services for Android and your Android app for web services...
 
Common mistakes in serverless adoption
Common mistakes in serverless adoptionCommon mistakes in serverless adoption
Common mistakes in serverless adoption
 
Akka for realtime multiplayer mobile games
Akka for realtime multiplayer mobile gamesAkka for realtime multiplayer mobile games
Akka for realtime multiplayer mobile games
 
improve website performance
improve website performanceimprove website performance
improve website performance
 
Apex code Benchmarking
Apex code BenchmarkingApex code Benchmarking
Apex code Benchmarking
 
Web performance testing
Web performance testingWeb performance testing
Web performance testing
 
10 practices that every developer needs to start right now
10 practices that every developer needs to start right now10 practices that every developer needs to start right now
10 practices that every developer needs to start right now
 
Serverless a superpower for frontend developers
Serverless a superpower for frontend developersServerless a superpower for frontend developers
Serverless a superpower for frontend developers
 
Introduction to KSS
Introduction to KSSIntroduction to KSS
Introduction to KSS
 
Building Single Page Apps with React.JS
Building Single Page Apps with React.JSBuilding Single Page Apps with React.JS
Building Single Page Apps with React.JS
 
code-camp-meteor
code-camp-meteorcode-camp-meteor
code-camp-meteor
 
Meetup React Sanca - 29/11/18 - React Testing
Meetup React Sanca - 29/11/18 - React TestingMeetup React Sanca - 29/11/18 - React Testing
Meetup React Sanca - 29/11/18 - React Testing
 
Angular vs React: Building modern SharePoint interfaces with SPFx
Angular vs React: Building modern SharePoint interfaces with SPFxAngular vs React: Building modern SharePoint interfaces with SPFx
Angular vs React: Building modern SharePoint interfaces with SPFx
 
Asp.Net MVC Intro
Asp.Net MVC IntroAsp.Net MVC Intro
Asp.Net MVC Intro
 
WordPress and Client Side Web Applications WCTO
WordPress and Client Side Web Applications WCTOWordPress and Client Side Web Applications WCTO
WordPress and Client Side Web Applications WCTO
 
Slideshare - Magento Imagine - Do You Queue
Slideshare - Magento Imagine - Do You QueueSlideshare - Magento Imagine - Do You Queue
Slideshare - Magento Imagine - Do You Queue
 
ESNext, service workers, and the future of the web
ESNext, service workers, and the future of the webESNext, service workers, and the future of the web
ESNext, service workers, and the future of the web
 
It's just Angular
It's just AngularIt's just Angular
It's just Angular
 
Vaugham Hong - Embedding JavaScript V8
Vaugham Hong - Embedding JavaScript V8Vaugham Hong - Embedding JavaScript V8
Vaugham Hong - Embedding JavaScript V8
 

Viewers also liked

Schema-free Microsoft Azure development
Schema-free Microsoft Azure developmentSchema-free Microsoft Azure development
Schema-free Microsoft Azure development
Inge Henriksen
 
Modern Development with Microsoft
Modern Development with MicrosoftModern Development with Microsoft
Modern Development with Microsoft
Joshua Drew
 
User and License Management on SharePoint Online
User and License Management on SharePoint OnlineUser and License Management on SharePoint Online
User and License Management on SharePoint Online
Terrence Nguyen
 
Azure.application development.nhut.nguyen
Azure.application development.nhut.nguyenAzure.application development.nhut.nguyen
Azure.application development.nhut.nguyen
Terrence Nguyen
 
Get set.. Introduction to Windows Azure Development
Get set.. Introduction to Windows Azure DevelopmentGet set.. Introduction to Windows Azure Development
Get set.. Introduction to Windows Azure Development
Thomas Robbins
 
Azure for software development teams
Azure for software development teamsAzure for software development teams
Azure for software development teams
Clemens Reijnen
 
Windows azure best practices - Dmitry Martynov
Windows azure best practices - Dmitry MartynovWindows azure best practices - Dmitry Martynov
Windows azure best practices - Dmitry Martynov
Alexey Bokov
 
Microsoft Windows Azure - Security Best Practices for Developing Windows Azur...
Microsoft Windows Azure - Security Best Practices for Developing Windows Azur...Microsoft Windows Azure - Security Best Practices for Developing Windows Azur...
Microsoft Windows Azure - Security Best Practices for Developing Windows Azur...
Microsoft Private Cloud
 
Scu2016 Azure Best practices
Scu2016 Azure Best practicesScu2016 Azure Best practices
Scu2016 Azure Best practices
Alexandre Verkinderen
 
Windows Azure Security Features And Functionality
Windows Azure Security Features And FunctionalityWindows Azure Security Features And Functionality
Windows Azure Security Features And Functionality
vivekbhat
 
Windows Azure Platform best practices by ericnel
Windows Azure Platform best practices by ericnelWindows Azure Platform best practices by ericnel
Windows Azure Platform best practices by ericnel
Eric Nelson
 
.Net Microservices with Event Sourcing, CQRS, Docker and... Windows Server 20...
.Net Microservices with Event Sourcing, CQRS, Docker and... Windows Server 20....Net Microservices with Event Sourcing, CQRS, Docker and... Windows Server 20...
.Net Microservices with Event Sourcing, CQRS, Docker and... Windows Server 20...
Javier García Magna
 
Azure Architecture Solutions Overview: Part 1
Azure Architecture Solutions Overview: Part 1Azure Architecture Solutions Overview: Part 1
Azure Architecture Solutions Overview: Part 1
Dzmitry Durasau
 
Azure vs AWS Best Practices: What You Need to Know
Azure vs AWS Best Practices: What You Need to KnowAzure vs AWS Best Practices: What You Need to Know
Azure vs AWS Best Practices: What You Need to Know
RightScale
 

Viewers also liked (14)

Schema-free Microsoft Azure development
Schema-free Microsoft Azure developmentSchema-free Microsoft Azure development
Schema-free Microsoft Azure development
 
Modern Development with Microsoft
Modern Development with MicrosoftModern Development with Microsoft
Modern Development with Microsoft
 
User and License Management on SharePoint Online
User and License Management on SharePoint OnlineUser and License Management on SharePoint Online
User and License Management on SharePoint Online
 
Azure.application development.nhut.nguyen
Azure.application development.nhut.nguyenAzure.application development.nhut.nguyen
Azure.application development.nhut.nguyen
 
Get set.. Introduction to Windows Azure Development
Get set.. Introduction to Windows Azure DevelopmentGet set.. Introduction to Windows Azure Development
Get set.. Introduction to Windows Azure Development
 
Azure for software development teams
Azure for software development teamsAzure for software development teams
Azure for software development teams
 
Windows azure best practices - Dmitry Martynov
Windows azure best practices - Dmitry MartynovWindows azure best practices - Dmitry Martynov
Windows azure best practices - Dmitry Martynov
 
Microsoft Windows Azure - Security Best Practices for Developing Windows Azur...
Microsoft Windows Azure - Security Best Practices for Developing Windows Azur...Microsoft Windows Azure - Security Best Practices for Developing Windows Azur...
Microsoft Windows Azure - Security Best Practices for Developing Windows Azur...
 
Scu2016 Azure Best practices
Scu2016 Azure Best practicesScu2016 Azure Best practices
Scu2016 Azure Best practices
 
Windows Azure Security Features And Functionality
Windows Azure Security Features And FunctionalityWindows Azure Security Features And Functionality
Windows Azure Security Features And Functionality
 
Windows Azure Platform best practices by ericnel
Windows Azure Platform best practices by ericnelWindows Azure Platform best practices by ericnel
Windows Azure Platform best practices by ericnel
 
.Net Microservices with Event Sourcing, CQRS, Docker and... Windows Server 20...
.Net Microservices with Event Sourcing, CQRS, Docker and... Windows Server 20....Net Microservices with Event Sourcing, CQRS, Docker and... Windows Server 20...
.Net Microservices with Event Sourcing, CQRS, Docker and... Windows Server 20...
 
Azure Architecture Solutions Overview: Part 1
Azure Architecture Solutions Overview: Part 1Azure Architecture Solutions Overview: Part 1
Azure Architecture Solutions Overview: Part 1
 
Azure vs AWS Best Practices: What You Need to Know
Azure vs AWS Best Practices: What You Need to KnowAzure vs AWS Best Practices: What You Need to Know
Azure vs AWS Best Practices: What You Need to Know
 

Similar to Windows Azure - Cloud Service Development Best Practices

닷넷 개발자를 위한 패턴이야기
닷넷 개발자를 위한 패턴이야기닷넷 개발자를 위한 패턴이야기
닷넷 개발자를 위한 패턴이야기
YoungSu Son
 
Moving applications to the cloud
Moving applications to the cloudMoving applications to the cloud
Moving applications to the cloud
Sergejus Barinovas
 
Migration testing framework
Migration testing frameworkMigration testing framework
Migration testing framework
IndicThreads
 
[DSBW Spring 2009] Unit 07: WebApp Design Patterns & Frameworks (3/3)
[DSBW Spring 2009] Unit 07: WebApp Design Patterns & Frameworks (3/3)[DSBW Spring 2009] Unit 07: WebApp Design Patterns & Frameworks (3/3)
[DSBW Spring 2009] Unit 07: WebApp Design Patterns & Frameworks (3/3)Carles Farré
 
Migrating from Struts 1 to Struts 2
Migrating from Struts 1 to Struts 2Migrating from Struts 1 to Struts 2
Migrating from Struts 1 to Struts 2
Matt Raible
 
CiklumJavaSat_15112011:Alex Kruk VMForce
CiklumJavaSat_15112011:Alex Kruk VMForceCiklumJavaSat_15112011:Alex Kruk VMForce
CiklumJavaSat_15112011:Alex Kruk VMForceCiklum Ukraine
 
my accadanic project ppt
my accadanic project pptmy accadanic project ppt
my accadanic project ppt
Manivel Thiruvengadam
 
Expanding a tree node
Expanding a tree nodeExpanding a tree node
Expanding a tree node
Hemakumar.S
 
Android Development w/ ArcGIS Server - Esri Dev Meetup - Charlotte, NC
Android Development w/ ArcGIS Server - Esri Dev Meetup - Charlotte, NCAndroid Development w/ ArcGIS Server - Esri Dev Meetup - Charlotte, NC
Android Development w/ ArcGIS Server - Esri Dev Meetup - Charlotte, NCJim Tochterman
 
I Feel Pretty
I Feel PrettyI Feel Pretty
I Feel Pretty
John Quaglia
 
Boston Computing Review - Java Server Pages
Boston Computing Review - Java Server PagesBoston Computing Review - Java Server Pages
Boston Computing Review - Java Server Pages
John Brunswick
 
Introducing Struts 2
Introducing Struts 2Introducing Struts 2
Introducing Struts 2
wiradikusuma
 
JUDCon London 2011 - Bin packing with drools planner by example
JUDCon London 2011 - Bin packing with drools planner by exampleJUDCon London 2011 - Bin packing with drools planner by example
JUDCon London 2011 - Bin packing with drools planner by example
Geoffrey De Smet
 
Android the Agile way
Android the Agile wayAndroid the Agile way
Android the Agile way
Ashwin Raghav
 
Struts2
Struts2Struts2
Struts2
yuvalb
 
Debugging and Error handling
Debugging and Error handlingDebugging and Error handling
Debugging and Error handlingSuite Solutions
 
Interoperable Web Services with JAX-WS
Interoperable Web Services with JAX-WSInteroperable Web Services with JAX-WS
Interoperable Web Services with JAX-WS
Carol McDonald
 
Aug Xml Net Forum Dynamics Integration
Aug Xml Net Forum Dynamics IntegrationAug Xml Net Forum Dynamics Integration
Aug Xml Net Forum Dynamics Integration
MariAnne Woehrle
 
Scaling Cairngorms
Scaling CairngormsScaling Cairngorms
Scaling Cairngorms
Glenn Goodrich
 
Beholding the giant pyramid of application development; why Ajax applications...
Beholding the giant pyramid of application development; why Ajax applications...Beholding the giant pyramid of application development; why Ajax applications...
Beholding the giant pyramid of application development; why Ajax applications...
Javeline B.V.
 

Similar to Windows Azure - Cloud Service Development Best Practices (20)

닷넷 개발자를 위한 패턴이야기
닷넷 개발자를 위한 패턴이야기닷넷 개발자를 위한 패턴이야기
닷넷 개발자를 위한 패턴이야기
 
Moving applications to the cloud
Moving applications to the cloudMoving applications to the cloud
Moving applications to the cloud
 
Migration testing framework
Migration testing frameworkMigration testing framework
Migration testing framework
 
[DSBW Spring 2009] Unit 07: WebApp Design Patterns & Frameworks (3/3)
[DSBW Spring 2009] Unit 07: WebApp Design Patterns & Frameworks (3/3)[DSBW Spring 2009] Unit 07: WebApp Design Patterns & Frameworks (3/3)
[DSBW Spring 2009] Unit 07: WebApp Design Patterns & Frameworks (3/3)
 
Migrating from Struts 1 to Struts 2
Migrating from Struts 1 to Struts 2Migrating from Struts 1 to Struts 2
Migrating from Struts 1 to Struts 2
 
CiklumJavaSat_15112011:Alex Kruk VMForce
CiklumJavaSat_15112011:Alex Kruk VMForceCiklumJavaSat_15112011:Alex Kruk VMForce
CiklumJavaSat_15112011:Alex Kruk VMForce
 
my accadanic project ppt
my accadanic project pptmy accadanic project ppt
my accadanic project ppt
 
Expanding a tree node
Expanding a tree nodeExpanding a tree node
Expanding a tree node
 
Android Development w/ ArcGIS Server - Esri Dev Meetup - Charlotte, NC
Android Development w/ ArcGIS Server - Esri Dev Meetup - Charlotte, NCAndroid Development w/ ArcGIS Server - Esri Dev Meetup - Charlotte, NC
Android Development w/ ArcGIS Server - Esri Dev Meetup - Charlotte, NC
 
I Feel Pretty
I Feel PrettyI Feel Pretty
I Feel Pretty
 
Boston Computing Review - Java Server Pages
Boston Computing Review - Java Server PagesBoston Computing Review - Java Server Pages
Boston Computing Review - Java Server Pages
 
Introducing Struts 2
Introducing Struts 2Introducing Struts 2
Introducing Struts 2
 
JUDCon London 2011 - Bin packing with drools planner by example
JUDCon London 2011 - Bin packing with drools planner by exampleJUDCon London 2011 - Bin packing with drools planner by example
JUDCon London 2011 - Bin packing with drools planner by example
 
Android the Agile way
Android the Agile wayAndroid the Agile way
Android the Agile way
 
Struts2
Struts2Struts2
Struts2
 
Debugging and Error handling
Debugging and Error handlingDebugging and Error handling
Debugging and Error handling
 
Interoperable Web Services with JAX-WS
Interoperable Web Services with JAX-WSInteroperable Web Services with JAX-WS
Interoperable Web Services with JAX-WS
 
Aug Xml Net Forum Dynamics Integration
Aug Xml Net Forum Dynamics IntegrationAug Xml Net Forum Dynamics Integration
Aug Xml Net Forum Dynamics Integration
 
Scaling Cairngorms
Scaling CairngormsScaling Cairngorms
Scaling Cairngorms
 
Beholding the giant pyramid of application development; why Ajax applications...
Beholding the giant pyramid of application development; why Ajax applications...Beholding the giant pyramid of application development; why Ajax applications...
Beholding the giant pyramid of application development; why Ajax applications...
 

Recently uploaded

DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Cheryl Hung
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
Elena Simperl
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
DianaGray10
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Product School
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Jeffrey Haguewood
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Product School
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
Alison B. Lowndes
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
Elena Simperl
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
Product School
 

Recently uploaded (20)

DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 

Windows Azure - Cloud Service Development Best Practices

  • 1. Windows Azure: Cloud service development best practices  Sriram Krishnan Program Manager Microsoft Corporation sriramk@microsoft.com
  • 3.
  • 4. void quicksort(int* array, int left, int right) { if(left >= right) return; int index = partition(array, left, right); quicksort(array, left, index - 1); quicksort(array, index + 1, right); }
  • 5.
  • 6.
  • 11.
  • 12.
  • 13. A few design choices
  • 16. Lots and lots of commodity machines
  • 18. What do you do about that pesky thing called state?
  • 19.
  • 20. Go horizontal Go stateless
  • 21. Store state in Windows Azure storage
  • 22. And it is the default out of the box!
  • 23. Session state provider <system.web>... <sessionStatemode="Custom"customProvider="TableStorageSessionStateProvider">             <providers>                 <addname="TableStorageSessionStateProvider“         type="Microsoft.Samples.ServiceHosting.AspProviders.TableStorageSessionStateProvider"                      applicationName=“Foo” />             </providers> </sessionState> </system.web>
  • 24. How do you deal with unreliable components?
  • 25.
  • 27. Use Windows Azure queues for separation of work
  • 29. Tight coupling : Default.aspx.cs publicpartialclass_Default : System.Web.UI.Page     {                   protectedvoid Button1_Click(objectsender,EventArgs e)         {             var order = txtOrder.Text;             ProcessOrder(order);         } protectedvoidProcessOrder(string order)         {   //Make some coffee! ...         }      }
  • 30. LB Default.aspx(Input) Worker.cs(Make Coffee) Windows Azure Queues
  • 31. Loose coupling : Default.aspx.cs publicpartialclass_Default : System.Web.UI.Page     {                   protectedvoid Button1_Click(objectsender,EventArgs e)         {             var order = txtOrder.Text;             QueueStorageqStore = QueueStorage.Create(_account);             MessageQueueorderQ = qStore.GetQueue("OrderQueue");             orderQ.PutMessage(newMessage(order));        }      }
  • 32. Loose coupling : WorkerRole.cs public class WorkerRole : RoleEntryPoint     {         public override void Start()         {             QueueStorageqStore = QueueStorage.Create(_account);             MessageQueueorderQ = qStore.GetQueue("OrderQueue");             while (true)             {                Message msg=orderQ.GetMessage(); if( msg != null)                 ProcessOrder(msg.ContentAsString());             }         }                 protected void ProcessOrder(string order)         { //Make some coffee! ...         }
  • 33. How do you deal with varying load?
  • 34. Build a thermostat for your service
  • 35. How do you deal with failures?
  • 36. Use Windows Azure storage for valuable data
  • 37. Be prepared to reconstruct local state…
  • 38. …since it can disappear any time
  • 39. Retry on transient failuresBut…
  • 41. Don’t launch a DoS attack on yourself
  • 44. Know when to throttle and shed load
  • 45. Case study: SmugMug and SkyNet
  • 46. When is ‘good enough’ good enough?
  • 48. Do all apps need the same guarantees?
  • 50.
  • 51.
  • 52. Stateless front-ends Loose coupling Building a thermostat Retrying on failures Loosening consistency Recap
  • 56. Hard to ‘undo’ a failed deployment
  • 57. Need to deal with both code and schema changes
  • 58. Code + data Update only one at a time
  • 60. Code vN +1 Data vN Code vN
  • 61. Data vN+1 Code vN Data vN
  • 63. If it looks like a duck and walks like a duck… http://www.flickr.com/photos/gaetanlee/298160415/
  • 64. Use version numbers in schema
  • 65.                                     } Schema without versioning   classEmployee : TableStorageEntity     {        public Employee(stringfirstName, stringlastName) :             base(firstName, lastName) //partition key, row key         {}           publicstringJobTitle         {             get;             set;         }       }  ...        varqResult = fromempin svc.CreateQuery<Employee>(EmployeeDataServiceContext.EmployeeTable)        whereemp.PartitionKey == "Steve" && emp.RowKey == "Marx         selectemp;
  • 66.                                     } Schema *with* versioning   classEmployee : TableStorageEntity     {        public Employee(stringfirstName, stringlastName) :             base(firstName, lastName)         {}           publicstringJobTitle         {             get; set;         }         publicint Version         {             get; set;         }      }  ...        varqResult = fromempin svc.CreateQuery<Employee>(EmployeeDataServiceContext.EmployeeTable)        whereemp.PartitionKey == "Steve" && emp.RowKey == "Marx && emp.Version == 1        selectemp;
  • 67. How do you do upgrades without downtime?
  • 69. Stage Deployment Production Deployment Swap for zero downtime upgrade
  • 70. + Stop + start for big changes or if downtime isn’t an issue
  • 72. When is the best time to update a service?
  • 74. Case study: Windows Live ID
  • 75. Update code or data Maintain compat Versioning in schemas Rolling upgrades Recap
  • 78.
  • 79.
  • 80.
  • 82.
  • 85.
  • 86. Act III When things go wrong…
  • 87. How do I debug?
  • 88. Use the Windows Azure SDK and debug locally to find bugs
  • 90.             Configuration files   ServiceDefinition.csdef <ServiceDefinitionname="DemoService">   <WebRolename="WebRole">    <ConfigurationSettings>       <Setting name="Color"/>     </ConfigurationSettings>   </WebRole> </ServiceDefinition> ServiceConfiguration.cscfg <ServiceConfigurationserviceName="DemoService">   <Rolename="WebRole">     <ConfigurationSettings>       <Setting name ="Color" value ="Red"/>     </ConfigurationSettings>   </Role> </ServiceConfiguration>
  • 92. How do I debug the cloud?
  • 94.             Configurable logging   <?xmlversion="1.0"?> <ServiceConfigurationserviceName=“DemoService”>   <Rolename="WebRole">     <Instancescount="1"/>     <ConfigurationSettings>       <Settingname ="LogLevel"value ="Verbose"/>     </ConfigurationSettings>   </Role> </ServiceConfiguration> ... if (RoleManager.GetConfigurationSetting("LogLevel") == "Verbose")        RoleManager.WriteToLog("Information", "Some log message");
  • 95. {XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX} Tag data with unique ID to track across the system
  • 96. How do I get notified when something bad happens?
  • 98. ! Email / IM / Phone
  • 99. The Big Red Button
  • 100. Use the SDK Separate code and config Configurable logging Alerts The Big Red Button Recap
  • 101. End of Act III
  • 102. Credits & Acknowledgements James Hamilton http://research.microsoft.com/~jamesrh/ Emre Kicimanhttp://research.microsoft.com/~emrek/ Pat Hellandhttp://blogs.msdn.com/pathelland/ What really happened on Mars http://research.microsoft.com/~mbj/mars_pathfinder/ Flickr blog post http://code.flickr.com/blog/2008/09/26/flickr-engineers-do-it-offline/ Don MacAskillhttp://blogs.smugmug.com/don/
  • 104. William of Ockhamc. 1288 - c. 1348
  • 105. Numquamponendaestpluralitas sine necessitate Plurality ought never be posited without necessity
  • 106. KISS
  • 109. © 2008 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.