10. Answering these Questions can be Difficult
So many alternative definitions from
different vendors
It can be difficult to describe what
the cloud can be used for
Keeping up with our beta and
released products is challenging
12. Session Objectives
Explore a Clear Definition
of Cloud Computing
Arm you with 5 Patterns for
Cloud-based Applications
Show you how to Implement these
Patterns using our Platform
24. Defining Cloud Computing
Application runs
on-premises
• Bring my own
machines,
Buy my own
connectivity,
software, etc.and
hardware,
• manage my own
Complete control
data center
and responsibility
• Upfront capital
costs for the
infrastructure
25. Defining Cloud Computing
Application runs Application runs at a
on-premises hoster
• Bring my own • Rent machines,
machines, connectivity,
Buy my own Pay someone to
software
connectivity,
software, etc.and
hardware, host my application
• Less control, but
• manage my own
Complete control using hardware that
fewer
data center
and responsibility I specify
responsibilities
• Upfront capital • Lower capital costs,
costs for the but pay for fixed
infrastructure capacity, even if idle
26. Defining Cloud Computing
Application runs Application runs at a Application runs using
on-premises hoster cloud platform
• Bring my own • Rent machines, • Shared,
machines, connectivity, multi-tenant
Pay someone for a
Buy my own Pay someone to
software environment
connectivity, pool of computing
software, etc.and
hardware, host my application
• Less control, but • Offers pool of
resources that can
• manage my own
Complete control using hardware that
fewer computing
be applied to a set
data center
and responsibility I specify
responsibilities resources,
of applications
abstracted from
• Upfront capital • Lower capital costs,
costs for the but pay for fixed infrastructure
infrastructure capacity, even if idle • Pay as you go
49. #1 - Using the Cloud for Scale
How would Jim do this today on premises?
Browser
Browser Web Tier
N
Browser L Web Tier B/L Tier Database
B
Browser Web Tier
Browser
50. #1 - Using the Cloud for Scale
How would Jim do this today on premises?
Browser
Browser B/L Tier
N
Browser Web Tier L B/L Tier Database
B
Browser B/L Tier
Browser
51. #1 - Using the Cloud for Scale
How would Jim do this today on premises?
Browser
Browser Web Tier B/L Tier
N N
Browser L Web Tier L B/L Tier Database
B B
Browser Web Tier B/L Tier
Browser
52. #1 - Using the Cloud for Scale
How would Jim do this today on premises?
Browser p1 p2 p3
Browser Web Tier B/L Tier
N N
Browser L Web Tier L B/L Tier Database
B B
Browser Web Tier B/L Tier
Browser
54. #1 - Using the Cloud for Scale
How would Jim do this today on premises?
Browser p1 p2 p3
Browser Web Tier B/L Tier
N N
Browser L Web Tier L B/L Tier Database
B B
Browser Web Tier B/L Tier
Browser “That took a lot of work - and money!”
55. #1 - Using the Cloud for Scale
How would Jim do this today on premises?
p1 p2 p3
“Not so great now…”
Web Tier B/L Tier
N N
Browser L Web Tier L B/L Tier Database
B B
Web Tier B/L Tier
“That took a lot of work - and money!”
“Hmmm... Most of this stuff is sitting idle...”
56. #1 - Using the Cloud for Scale
Datacenter peak load
Usage Idle time
Jan Apr Jul Oct
58. #1 - Using the Cloud for Scale
“Wow! What a great site!”
Request
Browser Web Role Worker Role Azure
Storage
Response
59. #1 - Using the Cloud for Scale
Browser
Browser
Browser Web Role Worker Role Azure
Storage
“Server Busy”
Browser
Browser
60.
61. #1 - Using the Cloud for Scale
Browser
Browser Web Role
N
Browser L Web Role Worker Role Azure
B Storage
Browser Web Role
Browser
You don’t see
this bit
62. #1 - Using the Cloud for Scale
Browser
Worker
Browser Web Role
Role
N N
Worker Azure
Browser L Web Role L
Role Storage
B B
Browser Worker
Web Role
Role
Browser
63. #1 - Using the Cloud for Scale
Browser p1 p2 p3
Worker
Browser Web Role
Role
N N
Worker Azure
Browser L Web Role L
Role Storage
B B
Browser Worker
Web Role
Role
Browser
64. OK, so changing config is easy...
…but what else do I need to know?
65. #1 - Using the Cloud for Scale
Browser p1 p2 p3
Worker
Browser Web Role
Role
N N
Worker Azure
Browser L Web Role L
Role Storage
B B
Browser Worker
Web Role
Role
Browser
66. #1 - Using the Cloud for Scale
Web Role Worker Role
Tight coupling between web and
worker role is an anti-pattern
67. #1 - Using the Cloud for Scale
4. Process
Web Role Worker Role
2. Respond to UI
Req
1 Place on queue
. 3. Pickup from queue
Queue
68. #1 - Using the Cloud for Scale
4. Process
Web Role Worker Role
Req 5. Add result to table
Queue
6. Query table on refresh
Table
71. #1 - Using the Cloud for Scale
Browser
Browser Web Role
N
Browser L Web Role Worker Role Azure
B Storage
Browser Web Role
Browser
Collate IIS logs
Testing
/ MOM pack
72. #1 - Using the Cloud for Scale
Web Role Worker Role
Req
Queue
73. #1 - Using the Cloud for Scale
Web Role Worker Role
Web Role Worker Role
Web Role Worker Role
Req Req Req
Queue
Web Role Worker Role
Web Role Monitor queue Worker Role
length against user’s
Web Role expectations Worker Role
74. Patterns for Cloud Computing
Takeaways
Using configuration, Azure makes it
easy to scale roles
Understand how to communicate
between Web and Worker role
Strategy on when to scale up/down
roles in production
81. #2 - Using the Cloud for Multi Tenancy
How would Jim do this today on premises?
Browser Web Tier B/L Tier Database
Customer #1
Browser Web Tier B/L Tier Database
Customer #2
Browser Web Tier B/L Tier Database
Customer #3
87. #2 - Using the Cloud for Multi Tenancy
Browser
Fixed Schema
Customer #1
Browser Web Tier B/L Tier Database
Customer #2
Browser
Option 1: Everyone Uses the Same Database/Schema
Customer #3
Pros: Simplest approach, easy to maintain/upgrade.
Cons: No customizations. Restoring of tenant data.
88. #2 - Using the Cloud for Multi Tenancy
Browser Database
Customer #1 Customer #1
Browser Web Tier B/L Tier Database
Customer #2 Customer #2
Browser Database
Customer #3 Customer #3
Option 2: Give Each Customer Their Own Database/Schema
Pros: Flexible. Tenant restore is easier. High Isolation.
Cons: Can be costly. Difficult to upgrade db schemas.
89. #2 - Using the Cloud for Multi Tenancy
Browser Fixed Schema
with Customizations
Customer #1
Browser Web Tier B/L Tier Database
Customer #2
Browser
Option 3: Fixed Database/Schema, with customizations
Customer #3
Pros: Customers can add their own custom fields
Cons: Non standard way of customizing the schema.
Tenant restore is difficult.
90. #2 - Using the Cloud for Multi Tenancy
Tenant
*
1
TenantID int
TenantName nvarchar
*
Employee
EmployeeId int TypeID
*
Type
int
FirstName nvarchar Name nvarchar
LastName nvarchar CLRType nvarchar
1 1
Customization
*
int
*
CustomizationID
Value nvarchar
91. #2 - Using the Cloud for Multi Tenancy
Tenant
*
1
TenantID 1
TenantName UK Branch
*
Employee
EmployeeId 1 TypeID
*
Type
1
FirstName Gordon Name PostalCode
LastName Brown CLRType string
1 1
Customization
*
1
*
CustomizationID
Value SW1 2AA
A
92. #2 - Using the Cloud for Multi Tenancy
Tenant
*
1
TenantID 2
TenantName US Branch
*
Employee
EmployeeId 2 TypeID
*
Type
2
FirstName Barack Name ZipCode
LastName Obama CLRType string
1 1
Customization
*
2
*
CustomizationID
Value 20500
93. #2 - Using the Cloud for Multi Tenancy
Tenant
*
1
Fixed Schema TenantID 2
Applies to All Could be both
TenantName US Branch
* *
Tenants
Employee Type
EmployeeId 2 TypeID 2
Customizable
FirstName Barack Tenant by Tenant Name ZipCode
LastName Obama Basis CLRType string
1 1
Customization
*
2
*
CustomizationID
Value 20500
98. Single Controller per Tenant
http://employeedata.cloudapp.net/CompanyA
(CompanyAController)
http://employeedata.cloudapp.net/CompanyB
(CompanyBController)
99. Shared Controller per Tenant
http://employeedata.cloudapp.net/CompanyA
(EmployeeController)
http://employeedata.cloudapp.net/CompanyB
(EmployeeController)
101. #2 - Using the Cloud for Multi Tenancy
http://hr.companya.co.uk
Browser
Customer #1 http://employeedata.cloudapp.net
Browser Web Tier B/L Tier Database
Customer #2
Browser
Customer #3
http://hr.companyb.com
102. #2 - Using the Cloud for Multi Tenancy
http://hr.companya.co.uk -> CNAME (employeedata.cloudapp.net)
Browser
Customer #1 http://employeedata.cloudapp.net
Browser Web Tier B/L Tier Database
Customer #2
Browser
Customer #3
http://hr.companyb.com -> CNAME (employeedata.cloudapp.net)
103. #2 - Using the Cloud for Multi Tenancy
http://hr.companya.co.uk -> CNAME (employeedata.cloudapp.net)
Browser
Customer #1 http://employeedata.cloudapp.net
Browser Web Tier B/L Tier Database
Customer #2 Use custom routing in ASP
.NET MVC
Browser
Customer #3
http://hr.companyb.com -> CNAME (employeedata.cloudapp.net)
105. Patterns for Cloud Computing
Takeaways
Always consider Multi Tenancy first,
even if only one customer
Design considerations must include
both data and UI
Many other considerations
(such as identity)
107. Patterns for Cloud Computing
Jim has seen how Azure enables multiple nodes
108. Patterns for Cloud Computing
“Can I use all of these nodes in parallel?”
109. Patterns for Cloud Computing
“I’ve got this multi-GB file I need analyzing…”
110. #3 - Using the Cloud for Compute
Data
Data Worker
Data
Client Master Worker
Data
Worker
111. #3 - Using the Cloud for Compute
Result
Worker
Result
Client Master Worker
Result
Worker
Result
112. Popularized by the term “MapReduce”*
* 2004 OSDI paper by Jeff Dean and Sanjay Ghemawat (Google)
113. #3 - Using the Cloud for Compute
How many ”e”’s in
“The quick brown fox jumps over the lazy dog”?
M<k,v>
Data Worker
M<k,v>
Client Master Worker
M<k.v>
Worker
“Map”
M<“the quick brown”.”e”>
M<“fox jumps over”.”e”>
M<“the lazy dog”.”e”>
114. #3 - Using the Cloud for Compute
L<k,v>
Worker
L<k,v>
Client Master Worker
Result
Worker
L<k,v>
3 x ”e”s found
“Reduce”
L<”e”,”1”>
L<”e”,”1”>
L<”e”,”1”>
116. #3 - Using the Cloud for Compute
Google
20pb of data analyzed every day using MapReduce
Yahoo!
10k+ cores, 4pb of data using MapReduce
Facebook
2500+ cores, 1pb of data using MapReduce
118. #3 - Using the Cloud for Compute
Apache Hadoop
Open Source Java “Inspired by MapReduce”
(Core, HDFS, many more)
Cloudera
Consulting, training, distribution of Hadoop
Amazon Elastic MapReduce
Hadoop implementation on EC2
120. #3 - Using the Cloud for Compute
How would Jim do this today on premises?
Data
Data Worker
Data
Client Master Worker
Client Application Job/Task Scheduler Worker
Data
Remote Service
122. #3 - Using the Cloud for Compute
Data
Worker
Data
Data
Worker
Client Web Role
Data
Client Application Job/Task Scheduler Worker
Remote Service
Req
Queue
Table
124. Patterns for Cloud Computing
Takeaways
MapReduce very visible, although
can be difficult to initially grasp
Learn about existing frameworks,
especially Apache Hadoop
Read up on Dryad (DryadLINQ) for
future direction
130. #4 - Using the Cloud for Storage
How would Jim do this today on premises?
File
RPC/NFS
Client File Server Store
131. #4 - Using the Cloud for Storage
How would Jim do this today on premises?
Data TDS (Tabular Data Stream)
Client DB Server RDBMS
132. #4 - Using the Cloud for Storage
How would Jim do this today on premises?
Data
HTTP POST
Browser Web Server Database
133. #4 - Using the Cloud for Storage
I love I love
you! you too!
Server Data
Affinity between your data and physical
hardware that serves it
134. #4 - Using the Cloud for Storage
I love I love
you! you too!
Server Data
Symptoms:
Which RAID number was that again?
Tedious to backup exponentially growing data
Crap! I’m at 95% capacity - got to move to a bigger disk
137. #4 - Using the Cloud for Storage
“Code Near” Pattern
Data access code near to home, long data connection
Client DAL
Cloud Storage
Good for offline scenarios + client applications
DAL -> Storage typically REST connection
138. #4 - Using the Cloud for Storage
“Code Far” Pattern
Data access code far from home, short data
connection
Client Web Tier DAL
Cloud Storage
Good for browser based scenarios, but no offline.
Good for “chattier” applications between DAL and database
141. #4 - Using the Cloud for Storage
PutBlob Blob Container
PUT http://account.blob.core.windows./net/containername/blobname
REST API
Client Azure
Blob Storage
http://account.blob.core.windows.net/containername/blobname
PutBlob = 64Mb MAX
MetaData = 8Kb per Blob
142. #4 - Using the Cloud for Storage
Blob Container
REST API
Client Azure
Blob Storage
GetBlob
GET http://account.blob.core.windows./net/containername/blobname
http://account.blob.core.windows.net/containername/blobname
143. #4 - Using the Cloud for Storage
Blob Container
REST API
Client Azure
Blob Storage
GetBlob
GET http://account.blob.core.windows./net/containername/blobname
Range: bytes=329300 - 730000
http://account.blob.core.windows.net/containername/blobname
144. #4 - Using the Cloud for Storage
PutBlock(blobname, blockid, data) Blob Container
PutBlockList(blobname, blockid1 …, blockidN)
,
REST API
Client Azure
Blob Storage
http://account.blob.core.windows.net/containername/blobname
PutBlock = 4Mb MAX to a maximum of 50Gb
BlockId = 64 bytes
146. #4 - Using the Cloud for Storage
REST:
GET http://account.table.core.windows.net/Customer?$filter=%20PartitionKey%20eq%20value
LINQ:
var customers = from o in context.CreateQuery<customer>(“Customer”) where o.PartitionKey
== value select o;
Worker Role Azure
Table Storage
http://account.table.core.windows.net
Each Table:
PartitionKey (e.g. DocumentName) to ensure
scalability
RowKey (e.g. version number)
[fields] for data
161. Patterns for Cloud Computing
Takeaways
Understand the pricing model for
storage on-premises vs. cloud
Read up and understand code
near/code far models
SQL Azure as a factor for
migration/move from on premises
171. #5 - Using the Cloud for Communications
http://app.queue.core.windows.net/
REST
Client Azure Queue
172. #5 - Using the Cloud for Communications
Company 1
http://app.queue.core.windows.net/
Client
REST
Azure Queue
Company 2
Client
173. #5 - Using the Cloud for Communications
Company 1
http://app.queue.core.windows.net/
Client
REST
Azure Queue
Company 2
Client
174. #5 - Using the Cloud for Communications
Company 1
http://app.queue.core.windows.net/
Client
Master Key
REST
Azure Queue
Company 2
Client
Master Key
175. #5 - Using the Cloud for Communications
Company 1
http://app.queue.core.windows.net/
Client
REST
Web Role Azure Queue
Company 2
Client
176. #5 - Using the Cloud for Communications
Proxy?
Company 1
Firewall
http://app.queue.core.windows.net/
Client
REST
Web Role Azure Queue
Company 2
Client
Firewall
177. #5 - Using the Cloud for Communications
Company 1
Firewall
http://app.queue.core.windows.net/
Client
REST
Web Role Azure Queue
Company 2 65.55.33.204
Client
Firewall
192.168.14.100
NAT?
178. #5 - Using the Cloud for Communications
Company 1
Firewall
http://app.queue.core.windows.net/
Client
REST
Web Role Azure Queue
Company 2 65.55.33.204
Client
Firewall
192.168.14.100
OK, so I’ll do a HTTP
poll every minute
179. #5 - Using the Cloud for Communications
Company 1
Firewall
http://app.queue.core.windows.net/
Client
REST
Web Role Azure Queue
Company 2 65.55.33.204
Client
Firewall
192.168.14.100
…and how about other
protocols other than HTTP?
181. #5 - Using the Cloud for Communications
Company 1
sb://.../myqueue
Client
.NET
Service Bus
Company 2
Client
Firewall
Outbound bi-directional socket
Kept alive in background
182. #5 - Using the Cloud for Communications
Company 1
Firewall
sb://.../myqueue
Client Outbound one-way socket
.NET
Service Bus
Company 2
Message routed
Client
accordingly
Firewall
Outbound bi-directional socket
Kept alive in background
183. #5 - Using the Cloud for Communications
This Conference
MySQL Admin Firewall
sb://.../myqueue
My Laptop Outbound one-way socket
Localhost:1000
.NET
Service Bus
My Home
Message routed
Home PC
accordingly
192.168.14.193 Firewall
Outbound bi-directional socket
Kept alive in background
My SQL
Port 3306
185. Patterns for Cloud Computing
Takeaways
Be careful consuming Azure queues
directly via REST
Firewalls/NATs can add additional
trouble (especially non-HTTP)
Learn how .NET Service Bus
traverses in these scenarios
187. Next Steps
Obviously, our friend Jim, is fake…
188. Next Steps
Make sure you have a clear definition
of Cloud Computing
Explore the 5 usage patterns for
your scenarios today
Think about the next steps for
implementation and migration