Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
10 things ever architect should know about the Windows Azure Platform - ericnel
1. 10 things every architect needs to know
Eric Nelson | ISV Application Architect | Microsoft UK
eric.nelson@microsoft.com | http://bit.ly/ericnelson | http://twitter.com/ericnel
Page 1
2. Assumption
• You already have some
familiarity with the Windows
Azure Platform
• If you don’t then you will still
learn stuff
– But you will be missing some
context. Sorry
– Also check out
• http://bit.ly/azuretrenchesbookvol1
• http://ukazure.ning.com/events
Page 2
5. 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
13. 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 13
14. “Typical” Azure Application
Windows Azure Platform
Your Data
Web Site
Web Site
Web ASMX,WCF)
(ASPX, Role
(ASPX, ASMX,
WCF)
Queues
(ASPX, WCF, PhP)
L
B
Worker
Worker L
Blobs
Service
Role
B
Internet Your Code Tables
Your Relational Data
Tables Views SPs Triggers
Page 14
15. Is it just about this?
“On and Off “ “Growing Fast“
Compute
Compute Inactivity
Period
Average
Average Usage Usage
Time Time
On and off workloads (e.g. batch Successful services needs to
job) grow/scale
Over provisioned capacity is wasted Keeping up w/growth is big IT
Time to market can be cumbersome challenge
Complex lead time for deployment
“Unpredictable “Predictable Bursting“
Bursting“
Compute
Average Compute Average
Usage Usage
Time Time
Unexpected/unplanned peak in demand Services with micro seasonality trends
Sudden spike impacts performance Peaks due to periodic increased demand
Can’t over provision for extreme cases IT complexity and wasted capacity
Page 15
16. Or is it also about this?
“I want to try “Departmental“
something now“
Machines
Machines
Time Time
Need to quickly provision new Need to quickly provision new
machines for a temporary period of machines for a departmental solution
time
“Just store “Extend to
data in the Cloud“ the Cloud“
With all processing elsewhere Extend existing applications
“Migrate existing “New hybrid services“
applications“
Benefits of reduced operational costs On-premise and Cloud aka S+S
Page 16
17. Behavioral changes
Developers
feel
empowered
Cost of
Developers
architectural
become
decisions is
entrepreneurs
more visible
Page 17
20. Dynamic Environment means…
Windows
Traditional Azure
Control over network topology Admin Limited control over IPs, ports
and machines Control
Consistent bandwidth with
stable latency Latency Variable latency and bandwidth
Control over machine Machine names can change
identification Identification every time an instance starts
Limited control over lifetime,
Control over machine lifetime Volatility state becomes transient
Page 20
21. Admin control (or lack of it)
• Limited access to local environment and state
– No admin rights and privileges are available (yet).
– No pre-setup or configuration can be done (yet).
• Code defines exact set up of roles which
provides uniformity across instances
Page 21
22. Volatility: Your instances will be stopped
Patching
React
• When an instance goes away, it’s
Notification of gone, including its state!
Moving instance • Properly handle state so it can
lifecycle events be preserved.
Failure
Page 22
24. Dynamic networking
• Dynamic environment means dynamic
networking
– Ports changes
– IPs change
– Cannot rely on node IPs or machine names
• The traditional way of networking may no longer
be the best fit.
– Direct communication is possible
– Shift to indirect
• Using Windows Azure storage
• Using Windows Azure Service Bus
Page 24
26. 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 26
27. 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 27
28. 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 28
30. 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 30
31. 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 31
36. 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
SQL Azure
Per GB allocated database
by day
Page 36
37. Data center usage costing comparison
Web Role Web Role
Transaction Transaction
Browser Image Download Blob Browser Image Download Blob
Bandwidth Bandwidth
Egress Egress
TIP: Increasing the size of the VM will increase network throughput
Page 37
38. Batch Payloads
Frequent message Option 1:
passing with a small Serialized
# of transactions
amount of data can Message
Passing
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 txs
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 38
39. 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 39
40. 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
Page 40
41. 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 41
42. 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 42
43. 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 43
44. 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 44
47. 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 47
48. You have many choices for data
Relational Database
Structured Storage
Unstructured Storage
NTFS Drive
Service Communication
Page 48
49. Side by Side Evaluation
Single SQL
Single Blob Drive Queue Table Azure
Database
Structured Data Y Y
Relational Database Y
Server Side Processing Y
Direct Access from outside
Y Y Y Y
Azure
Messaging Infrastructure Y
Persistent Storage Y Y 1 week Y Y
200 GB/ 1
Size Limit 1 TB 100 TB 100 TB 50 GB (*)
TB
Page 49
50. Example: Registry/Configuration/User
Settings
A traditional set of data that is traditionally stored on the local
environment is configuration and 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 50
51. 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 51
52. 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 52
55. 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 Premises
Other Information
Social Security #
On Premises
Other Information
Page 55
56. 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 56
58. Summary
• Windows Web Development best practices apply
• But
• Cost becomes surprisingly significant in shaping
architectures
• Plenty of early adopters, therefore
– Good Architecture guidance is now appearing
– Plenty of detail to dig into
Page 58
59. 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 59