SlideShare ist ein Scribd-Unternehmen logo
1 von 109
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.

Weitere ähnliche Inhalte

Was ist angesagt?

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 2008Caleb 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 adoptionYan Cui
 
Akka for realtime multiplayer mobile games
Akka for realtime multiplayer mobile gamesAkka for realtime multiplayer mobile games
Akka for realtime multiplayer mobile gamesYan Cui
 
improve website performance
improve website performanceimprove website performance
improve website performanceamit Sinha
 
Apex code Benchmarking
Apex code BenchmarkingApex code Benchmarking
Apex code BenchmarkingAmit Chaudhary
 
Web performance testing
Web performance testingWeb performance testing
Web performance testingPatrick 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 nowCaleb Jenkins
 
Serverless a superpower for frontend developers
Serverless a superpower for frontend developersServerless a superpower for frontend developers
Serverless a superpower for frontend developersYan Cui
 
Introduction to KSS
Introduction to KSSIntroduction to KSS
Introduction to KSSQuintagroup
 
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 TestingAugusto 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 SPFxDimcho Tsanov
 
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 WCTORoy 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 webJemuel Young
 
It's just Angular
It's just AngularIt's just Angular
It's just AngularVinci Rufus
 
Vaugham Hong - Embedding JavaScript V8
Vaugham Hong - Embedding JavaScript V8Vaugham Hong - Embedding JavaScript V8
Vaugham Hong - Embedding JavaScript V8Allen Pike
 

Was ist angesagt? (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
 

Andere mochten auch

Schema-free Microsoft Azure development
Schema-free Microsoft Azure developmentSchema-free Microsoft Azure development
Schema-free Microsoft Azure developmentInge Henriksen
 
Modern Development with Microsoft
Modern Development with MicrosoftModern Development with Microsoft
Modern Development with MicrosoftJoshua 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 OnlineTerrence Nguyen
 
Azure.application development.nhut.nguyen
Azure.application development.nhut.nguyenAzure.application development.nhut.nguyen
Azure.application development.nhut.nguyenTerrence 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 DevelopmentThomas Robbins
 
Azure for software development teams
Azure for software development teamsAzure for software development teams
Azure for software development teamsClemens Reijnen
 
Windows azure best practices - Dmitry Martynov
Windows azure best practices - Dmitry MartynovWindows azure best practices - Dmitry Martynov
Windows azure best practices - Dmitry MartynovAlexey 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
 
Windows Azure Security Features And Functionality
Windows Azure Security Features And FunctionalityWindows Azure Security Features And Functionality
Windows Azure Security Features And Functionalityvivekbhat
 
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 ericnelEric 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 1Dzmitry 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 KnowRightScale
 

Andere mochten auch (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
 

Ähnlich wie 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 cloudSergejus Barinovas
 
Migration testing framework
Migration testing frameworkMigration testing framework
Migration testing frameworkIndicThreads
 
[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 2Matt Raible
 
CiklumJavaSat_15112011:Alex Kruk VMForce
CiklumJavaSat_15112011:Alex Kruk VMForceCiklumJavaSat_15112011:Alex Kruk VMForce
CiklumJavaSat_15112011:Alex Kruk VMForceCiklum Ukraine
 
Expanding a tree node
Expanding a tree nodeExpanding a tree node
Expanding a tree nodeHemakumar.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
 
Boston Computing Review - Java Server Pages
Boston Computing Review - Java Server PagesBoston Computing Review - Java Server Pages
Boston Computing Review - Java Server PagesJohn Brunswick
 
Introducing Struts 2
Introducing Struts 2Introducing Struts 2
Introducing Struts 2wiradikusuma
 
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 exampleGeoffrey De Smet
 
Android the Agile way
Android the Agile wayAndroid the Agile way
Android the Agile wayAshwin Raghav
 
Struts2
Struts2Struts2
Struts2yuvalb
 
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-WSCarol McDonald
 
Aug Xml Net Forum Dynamics Integration
Aug Xml Net Forum Dynamics IntegrationAug Xml Net Forum Dynamics Integration
Aug Xml Net Forum Dynamics IntegrationMariAnne Woehrle
 
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.
 

Ähnlich wie 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...
 

Kürzlich hochgeladen

Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbuapidays
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelDeepika Singh
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Zilliz
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusZilliz
 

Kürzlich hochgeladen (20)

Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 

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.