Upload
codecampiasi
View
93
Download
0
Embed Size (px)
DESCRIPTION
CodeCampIasi25Oct2014
Citation preview
Patterns for Scalability in
Microsoft Azure Applications
(starting at 17.00)Alex Mang
alexmang.ro | @mangalexandru
25th of October 2014
•Alex Mang
•CEO @ KeyTicket Solutions
• Event management and
on-line ticketing, powered by Azure
• Microsoft BizSpark Plus
(1/4 nation-wide)
•Azure Advisor
•Husband & father
Speaker.Bio.ToString()
• They promised crazy scaling capacity
•… & they fulfilled their promise
•… but my apps are still under-performing
Context of cloud apps
Common Architecture
Queue-Based Load Pattern
Queue Based Load Leveling Pattern
Source: Microsoft Patterns & Practices - Cloud Design Patterns
Possible bottlenecks
Competing-Consumers Pattern
Source: Microsoft Patterns & Practices - Cloud Design Patterns
What about important messages?
Priority Queue Pattern
Competing Consumers Pattern
Source: Microsoft Patterns & Practices - Cloud Design Patterns
Recap
Queue-based Load:
- Removes app failure caused by 3rd party
services
Competing-Consumers:
- Ensures messages (= tasks) are processed
faster, even under high load
Priority Queue:
- Ensures important tasks run first
DEMO
PRIORITY QUEUE PATTERN
•Most developers think about how data is
stored in OOP manner
• In NoSQL, commonly store everything in a
single entity
• In SQL, we have size constraints
• End-up in:
• Performance impact
• High prices
What about data repo. limit.?
•Can generate views in advance, containing
data on a per-requirement basis
•Only contain data required by query
• Include current values of calculated columns
or data items
•May be optimized for a single queries
•Updated a.s.a.p. (schedule / triggered)
What about data repo. limit.? (cont’)
Materialized-View Pattern
Source: Microsoft Patterns & Practices - Cloud Design Patterns
Materialized-View Pattern
Materialized View Pattern ExampleSource: Microsoft Patterns & Practices - Cloud Design Patterns
Materialized-View Pattern
When to use
Queries are complex
Data difficult to query directly
Temporary views dramatically improve perf.
Temporary views act as DTOs for UI,
reporting etc.
Data store not always available (SQL Azure)
Security or privacy reasons
Recap
So far, I’ve talked about:
• Taking pieces of code out of the ‘front facing’ apps
• Messaging methods between apps and consumers
• Simple queue
• Priority queue
• Response queues
• Partitioning data into views
• Materialized views!
Hip-hip, Hurray!
WE CAN SCALE OUR COMPUTE ROLES!
But what about data?
• Thought:
If we scale-out our compute roles…
… why not scale out our databases too?
Sharding Pattern
• Scale-up vs. scale-out applies to dbs. too!
• Shard = horizontal partition of overall data
•Must scale out data because:
• Storage limitations
• Concurrent requests
• Customer isolation
• Geography
Sharding Pattern (cont’ed)
•Horizontal partitions of data
• (a.k.a. shards)
• Same schema, different data
•Runs on its own server
•Benefits:
• Use commodity hardware
• Better performance
• Closely located geographically
Sharding Pattern (cont’ed)
Source: Microsoft Patterns & Practices - Cloud Design Patterns
Strategy Advantages Considerations
Lookup • More control
• Easy shard rebalance
• Shard lookup may
create additional
overhead
Range • Easy to implement
• Works well on range queries
• Easy management
• Suboptimal balance
• Shard rebalance is
difficult
Hash • Best balance
• Request routing directly via
hashing alg.
• Calculating hash may
create additional
overhead
• Rebalance is difficult
Sharding Pattern (cont’ed)
DEMO
SHARDING PATTERN
•Microsoft Patterns & Practices:
• Cloud Design Patterns
http://msdn.microsoft.com/en-
us/library/dn568099.aspx
• Developing Multi-tenant Apps. for the Cloud:
http://msdn.microsoft.com/en-
us/library/ff966499.aspx
• Moving Applications to the Cloud:
http://msdn.microsoft.com/en-
us/library/ff728592.aspx
References
References (cont’ed)
•Get Started with Azure SQL Database Elastic
Scale Preview
• http://azure.microsoft.com/en-
us/documentation/articles/sql-database-elastic-
scale-get-started/
• Elastic Scale Documentation Map
• http://azure.microsoft.com/en-
us/documentation/articles/sql-database-elastic-
scale-documentation-map/
• Elastic Scale Sample App
MVA
•Microsoft Virtual Academy
•On-line curricula
• Getting started courses
• Deep dives
• “How To”s
• Live Events
•Compete against friends & colleagues
MVA (cont’ed)
•Personal learning paths
• Earn points for each course
•Romania TOP 10 / week / month / all-time
•WIN PRIZES (phones, tablets etc.)
www.microsoftvirtualacademy.com
•Did I mention PRIZES?
Q & A
Thank you!
Patterns for Scalability in Microsoft Azure Applications
Alex Mang
alexmang.ro | @mangalexandru
25th of October 2014
Please fill the online evaluation form after event