• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Windows Azure Platform best practices by ericnel
 

Windows Azure Platform best practices by ericnel

on

  • 2,449 views

50minute discussion of best practices for Windows Azure Platform delivered at DevCon London, Sept 2010

50minute discussion of best practices for Windows Azure Platform delivered at DevCon London, Sept 2010

Statistics

Views

Total Views
2,449
Views on SlideShare
2,231
Embed Views
218

Actions

Likes
2
Downloads
68
Comments
0

17 Embeds 218

http://geekswithblogs.net 100
http://oakleafblog.blogspot.com 63
http://blogs.msdn.com 15
http://oakleafblog.blogspot.in 10
http://oakleafblog.blogspot.fr 5
http://oakleafblog.blogspot.co.uk 4
http://oakleafblog.blogspot.ca 4
http://oakleafblog.blogspot.jp 3
http://oakleafblog.blogspot.fi 3
http://oakleafblog.blogspot.sg 2
http://oakleafblog.blogspot.ch 2
http://oakleafblog.blogspot.com.au 2
http://oakleafblog.blogspot.com.es 1
http://oakleafblog.blogspot.se 1
http://oakleafblog.blogspot.de 1
http://oakleafblog.blogspot.cz 1
http://oakleafblog.blogspot.ru 1
More...

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Windows Azure Platform best practices by ericnel Windows Azure Platform best practices by ericnel Presentation Transcript

    • Windows Azure Platform Best Practices Eric Nelson | ISV Application Architect | Microsoft UK eric.nelson@microsoft.com | http://bit.ly/ericnelson | http://twitter.com/ericnel Page 1
    • Assumption • You already have familiarity with the Windows Azure Platform • If you don’t then you will still learn stuff – But you will be missing some context. Sorry Page 2
    • Agenda Overview • Role Instances • Latency & timeouts • Transactions & bandwidth • Data/state • Data sensitivity Summary Page 3
    • Overview Page 4
    • Windows Azure Platform makes it easy and cost effective to run your applications and store your data inside Microsoft Data Centres using existing skills and integrate with your existing on-premise applications Page 5
    • Vs traditional Windows development It’s not really It’s not really different. different. There is just There is just more of it less of it Therefore many Windows Web development best practices apply Page 6
    • Agenda Overview • Role Instances • Latency & timeouts • Transactions & bandwidth • Data/state • Data sensitivity Summary Page 7
    • Role Instances Page 8
    • Instances of Role Types “Typical Application” But… Finance Web Message Finance Web Web Role A Message Role A Role A Queue Queue 10 Sec 10 Sec Worker Role A Worker Worker Role A Role A TIP: Queue writes are approx 20/s per writer Page 9
    • Consolidation of Role Types Scalable Message Passing Meta-Message Passing HR Finance Sales HR Finance Sales Message Message Message Message Message Message Meta-queue HR HR Finance Sales Finance Queue Queue Queue Sales 10 10 5 Finance Sec Sec Sec 10 Sec Worker Worker Worker Meta-worker Role Role Role Role Message Type? TIP: Web Roles can communicate direct to Workers TIP: Maximum time to process a Q Item is 2 hours Page 10
    • Remember that SLA? Your instances will stop Patching React Notification of • When an instance goes away, it’s Moving instance gone, including its state! lifecycle events Failure Page 11
    • Role instance management example Page 12
    • Elasticity and Roles From this To this Finance Web Web Finance Web Web Web Message Role A Role A Message Role A Role A Role A 10 to 15 Queue minutes Queue 10 Sec 10 Sec Worker Worker Worker Worker Role A Role A Role A Role A Page 13
    • Latency and Timeouts Page 14
    • Latency On premises application App Data Service App Request Consistent and accepted latencies Cloud based application App Service Data App Request Increases in quantity and variability of latencies TIP: Expect Web Role to SQL Azure to take about twice as long Page 15
    • Timeout On premises application Try to connect Service App App Request Data Consistent, reliable connectivity and access Connection Yes Continue doing Successful? work Cloud based application Timeouts? No Service App App Request Data No Tried 5 Yes Increased likelihood of timeouts times? Fail Page 16
    • SQL Azure – you must use retries! • Transient network issues – Loss of connection • The Fabric may auto-magically reconnect your session to a replica of your data – Some result in termination of client session • Throttling – Excessive resource usage, long running transactions – Can lead to • Termination of client session • Temporary inability to establish a new connection Page 17
    • Timeout Retry Code Example Page 18
    • Timeout Retry Code Example TIP: There is a new code library for all this! Page 19
    • Transactions & bandwidth Page 20
    • Transactions & bandwidth •Bandwidth • Charged for usage • Functionality that was not bandwidth Access Control based may now be effected. Per AC transactions/month • E.g. using Windows Azure Blobs instead of writing to disk Bandwidth Per GB transfer to/from datacenter •Transactions • Charged by quantity Storage • Access types that were not Per GB stored & transactions traditionally on a transaction count may now be effected. Service Bus • E.g. using Access Control Services Per connection/month and Storage Page 21
    • Data center usage costing comparison Web Role Web Role Transaction Transaction Browser Image Download Blob Browser Image Download Blob Bandwidth Bandwidth Egress Egress Page 22
    • Batch Payloads Frequent message Option 1: passing with a small Serialized amount of data can Message Passing # of ops Header effect performance and Header Header cost. Header Header Content Content Content Header Total Bytes or Content Overhead Content Content Content Header Message Content Structure Content Header Option 2; Content # of ops TIP: Q items 8KB limit Packaged Message Content TIP: Watch out for data formats! Passing Content Total Bytes TIP: Use storage APIs to group transactions Page 23
    • Batch Queries Single Query Use Batch Query Use Query Worker Query Role A Query Worker Worker Query Query Role Role B Query Worker Query Query Reduction of bandwidth Role C and transactions! Query Worker Query Query Role D Query Worker Role Worker Query Query Role E Query Page 24
    • Be aware of “new costs” e.g. polling • Consider introducing polling a queue every 100ms • 25,920,000 polls/month • £0.0061 per 10,000 storage transactions • Therefore it will cost – £15.81/month • To get an SLA, need two worker roles polling – £31.62/month • Cost of two workers – £0.0728 per hour x 720 x 2 – £104.83/month • Total cost £136.45/month TIP: Yet a 1GB SQL Azure will cost you £6/month  Page 25
    • Be aware of cost 140 million $140 Transactions per Month 120 million $120 Cost per Month 100 million $100 80 million $80 60 million $60 40 million $40 20 million $20 0 1 instance 5 instances 100 ms 100 ms Instances polling storage Page 26
    • Be aware of cost 140 million $140 Transactions per Month 120 million $120 Cost per Month 100 million $100 80 million $80 60 million $60 40 million $40 20 million $20 0 5 instances 5 instances 100 ms 1 second Instances polling storage Page 27
    • Be aware of cost Be wary of frequent transactions with little work being done 140 million $140 Transactions per Month 120 million $120 Cost per Month Unnecessary Cost 100 million $100 80 million $80 60 million $60 40 million $40 20 million $20 0 5 instances Polls which 100 ms found work Instances polling storage Page 28
    • Polling best practices • Poll less often • Synchronize polling with business needs 8am to 12am til 4am 12pm – – every 1 every 100ms minute 4am til 8am – every 10 seconds Page 29
    • Polling best practices cont. Scalable Message Passing Meta-Message Passing HR Finance Sales HR Finance Sales Message Message Message Message Message Message Meta-queue HR HR Finance Sales Finance Queue Queue Queue Sales 10 10 5 Finance Sec Sec Sec 10 Sec Worker Worker Worker Meta-worker Role Role Role Role Message Type? Page 30
    • Data/State Page 31
    • Data/State • Windows Azure instances are highly dynamic – Role instance local data is volatile • Instances are independent – State changes are not reflected in other instances • Therefore – Local instance storage is only useful for temporary data or as a cache – All other data needs to be moved to durable storage Page 32
    • Durable forms of storage in Windows Azure • Windows Azure Storage – Blobs • Page – random read/writes • Block – streaming • Drive – legacy – Queues – Tables • SQL Azure Database – Tables TIP: SQL Azure has concurrency limits TIP: You need SQL Server 2008 R2 Management Studio TIP: Use Blob snapshots when you only need read access TIP: For heavy read systems, distribute Blob reads across many workers Page 33
    • Example: Registry/Configuration/User Settings Commonly this is stored in the registry, xml or ini files. Options Best Case Usage Blob storage Configuration file that is read only once during app load SQL database Used in environments where a SQL database already exists Windows Azure table User settings that may be changed externally from the environment Page 34
    • Tables are funky Entity: Shiny red Car PK, RK, TS, att1, att2, att8 Entity: Blue Bird PK, RK, TS, att1, att4 Entity: 2008 Tax Return PK, RK, TS, att1, att2, att8, att9, att23, att46, att40 Page 35
    • Tables for storing Data Why do this? Partition Row Key Data Data Data Data Key Customer ID Description Name Credit Card # Order Total Tracking ID 1 Customer John Smith xxxx-xxxx-xxxx-xxxx Partition A 1 Order – 1 £35.12 Z783lhs 1 Order – 2 £75.00 Z829bhb 2 Customer Bill Johnson xxxx-xxxx-xxxx-xxxx Partition B 2 Order – 3 £10.00 Z778asd 2 Order – 4 £42.00 Z239uhy 3 Customer Travis Jones xxxx-xxxx-xxxx-xxxx Partition C 3 Order – 5 £25.93 Z329nps 3 Order – 6 £80.94 Z440ydd Page 36
    • Selecting keys is … key Consider searching an address book Search By Partition Key Row Key Name Last name + First initial First name + Middle initial Phone number Area code Number Address County + city House number + Street name TIP: Table deletes take time TIP: Replicate data to avoid joins and increase indexes Page 37
    • Data Sensitivity Page 38
    • Segmentation Online Shop Online Shop Product catalogue Purchasing Product Database catalogue Secure Transaction (Service Bus) Page 39
    • Sharding Contact ID Contact ID First Name First Name Cloud Last Name Last Name Shipping Information Shipping Information Customer Credit Card # Social Security # Contact ID Billing Data Customer Credit Card # On Premise Other Information Social Security # On Premise Other Information Page 40
    • Encryption Contact ID Contact ID First Name First Name Cloud Last Name Last Name Shipping Information Shipping Information £!”$&$%!&£% Customer Credit Card # !£$&!%£&%* Social Security # £”$&!%*^(& Billing Data ^$”$&%$”& On Premises Other Information On Premises Page 41
    • Agenda Overview • Role Instances • Latency & timeouts • Transactions & bandwidth • Data/state • Data sensitivity Summary Page 42
    • Summary • Windows Web Development best practices apply • But • Cost becomes surprisingly significant in shaping architectures • Plenty of early adopters, therefore – Good best practice are now appearing – Plenty of detail to dig into Page 43
    • NEXT STEPS For latest slides and all the links http://bit.ly/ericnelson For more resources and information http://bit.ly/startazure As an ISV intending to explore/adopt azure, sign up to http://bit.ly/ukmpr and come along and meet with us http://blogs.msdn.com/b/ukisvdev Eric Nelson | ISV Application Architect | Microsoft UK eric.nelson@microsoft.com | http://bit.ly/ericnelson | http://twitter.com/ericnel Page 44