SlideShare uma empresa Scribd logo
1 de 57
Baixar para ler offline
Premium community conference on Microsoft technologies itcampro@ itcamp14#
Patterns for Scalability in
Microsoft Azure Applications
Alex Mang
http://alexmang.ro
@mangalexandru
Premium community conference on Microsoft technologies itcampro@ itcamp14#
Huge thanks to our sponsors & partners!
Premium community conference on Microsoft technologies itcampro@ itcamp14#
Premium community conference on Microsoft technologies itcampro@ itcamp14#
• Alex Mang
• CEO @ KeyTicket Solutions
–Microsoft BizSpark Plus
• Azure Advisor
• MS, MCP, MCSD
Speaker.Bio.ToString()
Premium community conference on Microsoft technologies itcampro@ itcamp14#
• Common requirements for cloud apps:
–Availability
–Data management
–Design and implementation
–Messaging
–Management and monitoring
–Performance and scalability
–Resiliency
–Security
What are patterns?
Premium community conference on Microsoft technologies itcampro@ itcamp14#
• Performance
–‘indication of responsiveness of a system to
execute any action within a given time interval’
• Scalability
–‘ability of a system to handle increases in load
without impact on performance’
Performance and Scalability Patterns
= ???
= ???
Premium community conference on Microsoft technologies itcampro@ itcamp14#
Performance and Scalability Patterns
Cache-aside
Competing consumersCQRS
Event sourcing
Index table
Materialized view
Priority Queue
Queue based
load leveling
Sharding
Static content
Throttling
Premium community conference on Microsoft technologies itcampro@ itcamp14#
QUEUE-BASED LOAD LEVELING
PATTERN
Premium community conference on Microsoft technologies itcampro@ itcamp14#
Queue-Based Load Leveling Pattern (Context)
• Cloud app require external services
• High load on cloud app means high load on
services
• External services may be less scalable
• High load on cloud app could result in
failing external services
• Possible self-throttling
Premium community conference on Microsoft technologies itcampro@ itcamp14#
Queue-Based Load Leveling Pattern (Solution)
• Force the processing of request inside a
queue
• Thus, load-leveled service requests
• Additional advantage: queue also works as
a buffer
Premium community conference on Microsoft technologies itcampro@ itcamp14#
Queue-Based Load Leveling Pattern (Solution)
Premium community conference on Microsoft technologies itcampro@ itcamp14#
Queue-Based Load Leveling Pattern (Consid.)
• Make sure services are scaled correctly
• Task senders may wait service replies
Premium community conference on Microsoft technologies itcampro@ itcamp14#
COMPETING CONSUMERS PATTERN
Premium community conference on Microsoft technologies itcampro@ itcamp14#
• Asynchronously process requests
• The number of concurrent requests over
time varies
• The time required for processing varies
Competing Consumers Pattern (Context)
Premium community conference on Microsoft technologies itcampro@ itcamp14#
Competing Consumers Pattern (Solution)
Premium community conference on Microsoft technologies itcampro@ itcamp14#
Competing Consumers Pattern (Considerations)
• Ordering
• Poisoned messages
• Result handling
• Message queue scaling
• Reliability
Premium community conference on Microsoft technologies itcampro@ itcamp14#
PRIORITY QUEUE PATTERN
Premium community conference on Microsoft technologies itcampro@ itcamp14#
• Asynchronous processing via queues
–Queues can’t sort messages (most of the
times)
• Push notification (15K) vs. e-mail (15K)
Priority Queue Pattern (Context)
Premium community conference on Microsoft technologies itcampro@ itcamp14#
• Queues with different priorities
• Consumers based on queue priority
Priority Queue Pattern (Solution)
Premium community conference on Microsoft technologies itcampro@ itcamp14#
Priority Queue Pattern (Solution)
Premium community conference on Microsoft technologies itcampro@ itcamp14#
Priority Queue Pattern (Considerations)
• What is ‘high priority’ vs ‘low priority’
• (Single pool consumers) high first, low after
• (Single pool consumers) elevate old
messages
• Multiple queues work best for less priority
definitions
Premium community conference on Microsoft technologies itcampro@ itcamp14#
Priority Queue Pattern (When To Use)
Push first, send after example
Multi-tenant applications
Different SLAs / customers
Premium community conference on Microsoft technologies itcampro@ itcamp14#
Priority Queue Pattern (When NOT To Use)
Messages have similar priority
No burst of messages in the queue ever
exists
Costs must be kept down
Premium community conference on Microsoft technologies itcampro@ itcamp14#
DEMO
PRIORITY QUEUE PATTERN
Premium community conference on Microsoft technologies itcampro@ itcamp14#
THROTTLING PATTERN
Premium community conference on Microsoft technologies itcampro@ itcamp14#
Throttling Pattern (Context)
• Cloud application load varies
–# active users (mostly during work hours)
–Type of activities (analysis at end of month)
• Sudden unanticipated bursts
–Poor performance
–Eventual failures
• SLA requirements
Premium community conference on Microsoft technologies itcampro@ itcamp14#
Throttling Pattern (Solution)
• Auto-scaling, for starters…
• Define resource soft limits
• Monitor resource usage
• Throttle users
–Based on business impact (tiers / plans)
–Based on users’ concurrent requests
• Degrade functionality
• Load-leveling pattern / priority-queue
pattern
Premium community conference on Microsoft technologies itcampro@ itcamp14#
Throttling Pattern (Solution)
Premium community conference on Microsoft technologies itcampro@ itcamp14#
Throttling Pattern (Solution)
Premium community conference on Microsoft technologies itcampro@ itcamp14#
Throttling Pattern (Considerations)
• Architectural decision: consider it while
designing
• Quick monitoring technique
• Notify accordingly
Premium community conference on Microsoft technologies itcampro@ itcamp14#
Throttling Pattern (When To Use)
• Meet SLA
• Prevent single user monopolize everything
• Gracefully handle activity bursts
• Control costs by limiting max. resource
usage
Premium community conference on Microsoft technologies itcampro@ itcamp14#
DEMO
THROTTLING PATTERN
Premium community conference on Microsoft technologies itcampro@ itcamp14#
Throttling Pattern (Demo)
Premium community conference on Microsoft technologies itcampro@ itcamp14#
MATERIALIZED VIEW PATTERN
Premium community conference on Microsoft technologies itcampro@ itcamp14#
• Most developers think about how data is
stored
• In NoSQL, we usually store everything in a
single entity
• In SQL, we have size constraints
• End-up in:
–Performance impact
–High prices
Materialized View Pattern (Context)
Premium community conference on Microsoft technologies itcampro@ itcamp14#
• 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 query
• Updated a.s.a.p. (schedule / triggered)
Materialized View Pattern (Solution)
Premium community conference on Microsoft technologies itcampro@ itcamp14#
Materialized View Pattern (Solution)
Premium community conference on Microsoft technologies itcampro@ itcamp14#
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
Security or privacy reasons
Premium community conference on Microsoft technologies itcampro@ itcamp14#
Materialized View Pattern (When NOT To Use)
Data source is simple to query
Data changes quickly
Consistency is most important
Premium community conference on Microsoft technologies itcampro@ itcamp14#
DEMO
MATERIALIZED VIEW PATTERN
Premium community conference on Microsoft technologies itcampro@ itcamp14#
Materialized View Pattern (Demo)
Premium community conference on Microsoft technologies itcampro@ itcamp14#
COMMAND AND QUERY
RESPONSIBILITY SEGREGATION
PATTERN
Premium community conference on Microsoft technologies itcampro@ itcamp14#
CQRS Pattern (Context)
• Traditional CRUD system do everything over
the same data store
• Typically, same entity for DB <--> UI <--> DB
Premium community conference on Microsoft technologies itcampro@ itcamp14#
CQRS Pattern (Context)
Premium community conference on Microsoft technologies itcampro@ itcamp14#
CQRS Pattern (Context)
• Many concurrent connections  FAIL
• Complex business logic  FAIL
• Too much data passed around
• Performance impact @ high load, due to
complex querying
• Security issues may arise
Premium community conference on Microsoft technologies itcampro@ itcamp14#
CQRS Pattern (Solution)
• Segregate read (queries) from write
(commands)
• Models for querying and for updating are
different
• Possible to access same store, better not to
Premium community conference on Microsoft technologies itcampro@ itcamp14#
CQRS Pattern (Solution)
Premium community conference on Microsoft technologies itcampro@ itcamp14#
CQRS Pattern (Considerations)
• Additional complexity
• Consistency considerations
• CQRS for parts of the application
• Use in conjuction with Event Source pattern
Premium community conference on Microsoft technologies itcampro@ itcamp14#
CQRS Pattern (When To Use)
Multiple concurrent operations
Already familiar with Domain-Driven-
Design techniques
Read performance ≠ write performance
Different teams (read vs. write)
App. lifecycle: model update, business logic
update
Premium community conference on Microsoft technologies itcampro@ itcamp14#
CQRS Pattern (When NOT To Use)
Simple business rules
Simple CRUD-style UI are enough
Across the whole system
Premium community conference on Microsoft technologies itcampro@ itcamp14#
SHARDING PATTERN
Premium community conference on Microsoft technologies itcampro@ itcamp14#
Sharding Pattern (Context)
• Why scale out compute, and not scale out
data?
• Must scale out data because:
–Storage limitations
–Concurrent requests
–Network bandwidth
–Geography
Premium community conference on Microsoft technologies itcampro@ itcamp14#
Sharding Pattern (Solution)
• Horizontal partitions of data
–(a.k.a. shards)
• Same schema, different data
• Runs on its own server
• Benefits:
–Scale out data service
–Use commodity hardware
–Better performance
–Closely located geographically
Premium community conference on Microsoft technologies itcampro@ itcamp14#
Sharding Pattern (Solution)
• Lookup strategy• Range strategy• Hash strategy
Premium community conference on Microsoft technologies itcampro@ itcamp14#
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 (Solution)
Premium community conference on Microsoft technologies itcampro@ itcamp14#
THANK YOU!
Premium community conference on Microsoft technologies itcampro@ itcamp14#
Q & A

Mais conteúdo relacionado

Semelhante a Patterns for Scalability in Windows Azure Applications (Alex Mang)

ITCamp 2011 - Mihai Tataran - Migrating to Azure
ITCamp 2011 - Mihai Tataran - Migrating to AzureITCamp 2011 - Mihai Tataran - Migrating to Azure
ITCamp 2011 - Mihai Tataran - Migrating to Azure
ITCamp
 
ITCamp 2013 - Mihai Tataran - Building Autoscalable Azure Applications
ITCamp 2013 - Mihai Tataran - Building Autoscalable Azure ApplicationsITCamp 2013 - Mihai Tataran - Building Autoscalable Azure Applications
ITCamp 2013 - Mihai Tataran - Building Autoscalable Azure Applications
ITCamp
 
ITCamp 2013 - Cristian Lefter - Transact-SQL from 0 to SQL Server 2012
ITCamp 2013 - Cristian Lefter - Transact-SQL from 0 to SQL Server 2012ITCamp 2013 - Cristian Lefter - Transact-SQL from 0 to SQL Server 2012
ITCamp 2013 - Cristian Lefter - Transact-SQL from 0 to SQL Server 2012
ITCamp
 
ITCamp 2011 - Cristian Lefter - SQL Server code-name Denali
ITCamp 2011 - Cristian Lefter - SQL Server code-name DenaliITCamp 2011 - Cristian Lefter - SQL Server code-name Denali
ITCamp 2011 - Cristian Lefter - SQL Server code-name Denali
ITCamp
 
ITCamp 2013 - Radu Vunvulea - Messaging Patterns in the Cloud
ITCamp 2013 - Radu Vunvulea - Messaging Patterns in the CloudITCamp 2013 - Radu Vunvulea - Messaging Patterns in the Cloud
ITCamp 2013 - Radu Vunvulea - Messaging Patterns in the Cloud
ITCamp
 
ITCamp 2012 - Dan Fizesan - Serving 10 million requests per day
ITCamp 2012 - Dan Fizesan - Serving 10 million requests per dayITCamp 2012 - Dan Fizesan - Serving 10 million requests per day
ITCamp 2012 - Dan Fizesan - Serving 10 million requests per day
ITCamp
 
ITCamp 2013 - Lorant Domokos - Chasing the one codebase, multiple platforms d...
ITCamp 2013 - Lorant Domokos - Chasing the one codebase, multiple platforms d...ITCamp 2013 - Lorant Domokos - Chasing the one codebase, multiple platforms d...
ITCamp 2013 - Lorant Domokos - Chasing the one codebase, multiple platforms d...
ITCamp
 
ITCamp 2013 - Martin Kulov - Agile Project Management with Team Foundation Se...
ITCamp 2013 - Martin Kulov - Agile Project Management with Team Foundation Se...ITCamp 2013 - Martin Kulov - Agile Project Management with Team Foundation Se...
ITCamp 2013 - Martin Kulov - Agile Project Management with Team Foundation Se...
ITCamp
 
ITCamp 2013 - Tobiasz Koprowski - 2AM A Disaster Just Began
ITCamp 2013 - Tobiasz Koprowski - 2AM A Disaster Just BeganITCamp 2013 - Tobiasz Koprowski - 2AM A Disaster Just Began
ITCamp 2013 - Tobiasz Koprowski - 2AM A Disaster Just Began
ITCamp
 
ITCamp 2011 - Stephen Forte - Kanban
ITCamp 2011 - Stephen Forte - KanbanITCamp 2011 - Stephen Forte - Kanban
ITCamp 2011 - Stephen Forte - Kanban
ITCamp
 
ITCamp 2012 - Ovidiu Beches - Developing SharePoint 2010 and Silverlight web ...
ITCamp 2012 - Ovidiu Beches - Developing SharePoint 2010 and Silverlight web ...ITCamp 2012 - Ovidiu Beches - Developing SharePoint 2010 and Silverlight web ...
ITCamp 2012 - Ovidiu Beches - Developing SharePoint 2010 and Silverlight web ...
ITCamp
 

Semelhante a Patterns for Scalability in Windows Azure Applications (Alex Mang) (20)

Busy Developers Guide to AngularJS (Tiberiu Covaci)
Busy Developers Guide to AngularJS (Tiberiu Covaci)Busy Developers Guide to AngularJS (Tiberiu Covaci)
Busy Developers Guide to AngularJS (Tiberiu Covaci)
 
Elements of DDD with ASP.NET MVC & Entity Framework Code First v2
Elements of DDD with ASP.NET MVC & Entity Framework Code First v2Elements of DDD with ASP.NET MVC & Entity Framework Code First v2
Elements of DDD with ASP.NET MVC & Entity Framework Code First v2
 
ITCamp 2011 - Mihai Tataran - Migrating to Azure
ITCamp 2011 - Mihai Tataran - Migrating to AzureITCamp 2011 - Mihai Tataran - Migrating to Azure
ITCamp 2011 - Mihai Tataran - Migrating to Azure
 
ITCamp 2013 - Mihai Tataran - Building Autoscalable Azure Applications
ITCamp 2013 - Mihai Tataran - Building Autoscalable Azure ApplicationsITCamp 2013 - Mihai Tataran - Building Autoscalable Azure Applications
ITCamp 2013 - Mihai Tataran - Building Autoscalable Azure Applications
 
ITCamp 2013 - Cristian Lefter - Transact-SQL from 0 to SQL Server 2012
ITCamp 2013 - Cristian Lefter - Transact-SQL from 0 to SQL Server 2012ITCamp 2013 - Cristian Lefter - Transact-SQL from 0 to SQL Server 2012
ITCamp 2013 - Cristian Lefter - Transact-SQL from 0 to SQL Server 2012
 
Azure SQL Database From A Developer's Perspective - Alex Mang
Azure SQL Database From A Developer's Perspective - Alex MangAzure SQL Database From A Developer's Perspective - Alex Mang
Azure SQL Database From A Developer's Perspective - Alex Mang
 
ITCamp 2011 - Cristian Lefter - SQL Server code-name Denali
ITCamp 2011 - Cristian Lefter - SQL Server code-name DenaliITCamp 2011 - Cristian Lefter - SQL Server code-name Denali
ITCamp 2011 - Cristian Lefter - SQL Server code-name Denali
 
ITCamp 2013 - Radu Vunvulea - Messaging Patterns in the Cloud
ITCamp 2013 - Radu Vunvulea - Messaging Patterns in the CloudITCamp 2013 - Radu Vunvulea - Messaging Patterns in the Cloud
ITCamp 2013 - Radu Vunvulea - Messaging Patterns in the Cloud
 
Messaging patterns in the cloud
Messaging patterns in the cloudMessaging patterns in the cloud
Messaging patterns in the cloud
 
ITCamp 2012 - Dan Fizesan - Serving 10 million requests per day
ITCamp 2012 - Dan Fizesan - Serving 10 million requests per dayITCamp 2012 - Dan Fizesan - Serving 10 million requests per day
ITCamp 2012 - Dan Fizesan - Serving 10 million requests per day
 
ITCamp 2013 - Lorant Domokos - Chasing the one codebase, multiple platforms d...
ITCamp 2013 - Lorant Domokos - Chasing the one codebase, multiple platforms d...ITCamp 2013 - Lorant Domokos - Chasing the one codebase, multiple platforms d...
ITCamp 2013 - Lorant Domokos - Chasing the one codebase, multiple platforms d...
 
The New Era of Code in the Cloud (Bogdan Toporan)
The New Era of Code in the Cloud (Bogdan Toporan)The New Era of Code in the Cloud (Bogdan Toporan)
The New Era of Code in the Cloud (Bogdan Toporan)
 
ITCamp 2013 - Martin Kulov - Agile Project Management with Team Foundation Se...
ITCamp 2013 - Martin Kulov - Agile Project Management with Team Foundation Se...ITCamp 2013 - Martin Kulov - Agile Project Management with Team Foundation Se...
ITCamp 2013 - Martin Kulov - Agile Project Management with Team Foundation Se...
 
ITCamp 2013 - Tobiasz Koprowski - 2AM A Disaster Just Began
ITCamp 2013 - Tobiasz Koprowski - 2AM A Disaster Just BeganITCamp 2013 - Tobiasz Koprowski - 2AM A Disaster Just Began
ITCamp 2013 - Tobiasz Koprowski - 2AM A Disaster Just Began
 
KoprowskiT_it_camp2013 - 2amADisasterJustBegan
KoprowskiT_it_camp2013 - 2amADisasterJustBeganKoprowskiT_it_camp2013 - 2amADisasterJustBegan
KoprowskiT_it_camp2013 - 2amADisasterJustBegan
 
ITCamp 2011 - Stephen Forte - Kanban
ITCamp 2011 - Stephen Forte - KanbanITCamp 2011 - Stephen Forte - Kanban
ITCamp 2011 - Stephen Forte - Kanban
 
Building a Scalable and reliable open source ML Platform with MLFlow
Building a Scalable and reliable open source ML Platform with MLFlowBuilding a Scalable and reliable open source ML Platform with MLFlow
Building a Scalable and reliable open source ML Platform with MLFlow
 
ITCamp 2012 - Ovidiu Beches - Developing SharePoint 2010 and Silverlight web ...
ITCamp 2012 - Ovidiu Beches - Developing SharePoint 2010 and Silverlight web ...ITCamp 2012 - Ovidiu Beches - Developing SharePoint 2010 and Silverlight web ...
ITCamp 2012 - Ovidiu Beches - Developing SharePoint 2010 and Silverlight web ...
 
How # (sharp) is Your Katana (Ciprian Jichici)
How # (sharp) is Your Katana (Ciprian Jichici)How # (sharp) is Your Katana (Ciprian Jichici)
How # (sharp) is Your Katana (Ciprian Jichici)
 
Alex mang patterns for scalability in microsoft azure application
Alex mang   patterns for scalability in microsoft azure applicationAlex mang   patterns for scalability in microsoft azure application
Alex mang patterns for scalability in microsoft azure application
 

Mais de ITCamp

ITCamp 2019 - Ivana Milicic - Color - The Shadow Ruler of UX
ITCamp 2019 - Ivana Milicic - Color - The Shadow Ruler of UXITCamp 2019 - Ivana Milicic - Color - The Shadow Ruler of UX
ITCamp 2019 - Ivana Milicic - Color - The Shadow Ruler of UX
ITCamp
 

Mais de ITCamp (20)

ITCamp 2019 - Stacey M. Jenkins - Protecting your company's data - By psychol...
ITCamp 2019 - Stacey M. Jenkins - Protecting your company's data - By psychol...ITCamp 2019 - Stacey M. Jenkins - Protecting your company's data - By psychol...
ITCamp 2019 - Stacey M. Jenkins - Protecting your company's data - By psychol...
 
ITCamp 2019 - Silviu Niculita - Supercharge your AI efforts with the use of A...
ITCamp 2019 - Silviu Niculita - Supercharge your AI efforts with the use of A...ITCamp 2019 - Silviu Niculita - Supercharge your AI efforts with the use of A...
ITCamp 2019 - Silviu Niculita - Supercharge your AI efforts with the use of A...
 
ITCamp 2019 - Peter Leeson - Managing Skills
ITCamp 2019 - Peter Leeson - Managing SkillsITCamp 2019 - Peter Leeson - Managing Skills
ITCamp 2019 - Peter Leeson - Managing Skills
 
ITCamp 2019 - Mihai Tataran - Governing your Cloud Resources
ITCamp 2019 - Mihai Tataran - Governing your Cloud ResourcesITCamp 2019 - Mihai Tataran - Governing your Cloud Resources
ITCamp 2019 - Mihai Tataran - Governing your Cloud Resources
 
ITCamp 2019 - Ivana Milicic - Color - The Shadow Ruler of UX
ITCamp 2019 - Ivana Milicic - Color - The Shadow Ruler of UXITCamp 2019 - Ivana Milicic - Color - The Shadow Ruler of UX
ITCamp 2019 - Ivana Milicic - Color - The Shadow Ruler of UX
 
ITCamp 2019 - Florin Coros - Implementing Clean Architecture
ITCamp 2019 - Florin Coros - Implementing Clean ArchitectureITCamp 2019 - Florin Coros - Implementing Clean Architecture
ITCamp 2019 - Florin Coros - Implementing Clean Architecture
 
ITCamp 2019 - Florin Loghiade - Azure Kubernetes in Production - Field notes...
ITCamp 2019 - Florin Loghiade -  Azure Kubernetes in Production - Field notes...ITCamp 2019 - Florin Loghiade -  Azure Kubernetes in Production - Field notes...
ITCamp 2019 - Florin Loghiade - Azure Kubernetes in Production - Field notes...
 
ITCamp 2019 - Florin Flestea - How 3rd Level support experience influenced m...
ITCamp 2019 - Florin Flestea -  How 3rd Level support experience influenced m...ITCamp 2019 - Florin Flestea -  How 3rd Level support experience influenced m...
ITCamp 2019 - Florin Flestea - How 3rd Level support experience influenced m...
 
ITCamp 2019 - Emil Craciun - RoboRestaurant of the future powered by serverle...
ITCamp 2019 - Emil Craciun - RoboRestaurant of the future powered by serverle...ITCamp 2019 - Emil Craciun - RoboRestaurant of the future powered by serverle...
ITCamp 2019 - Emil Craciun - RoboRestaurant of the future powered by serverle...
 
ITCamp 2019 - Eldert Grootenboer - Cloud Architecture Recipes for The Enterprise
ITCamp 2019 - Eldert Grootenboer - Cloud Architecture Recipes for The EnterpriseITCamp 2019 - Eldert Grootenboer - Cloud Architecture Recipes for The Enterprise
ITCamp 2019 - Eldert Grootenboer - Cloud Architecture Recipes for The Enterprise
 
ITCamp 2019 - Cristiana Fernbach - Blockchain Legal Trends
ITCamp 2019 - Cristiana Fernbach - Blockchain Legal TrendsITCamp 2019 - Cristiana Fernbach - Blockchain Legal Trends
ITCamp 2019 - Cristiana Fernbach - Blockchain Legal Trends
 
ITCamp 2019 - Andy Cross - Machine Learning with ML.NET and Azure Data Lake
ITCamp 2019 - Andy Cross - Machine Learning with ML.NET and Azure Data LakeITCamp 2019 - Andy Cross - Machine Learning with ML.NET and Azure Data Lake
ITCamp 2019 - Andy Cross - Machine Learning with ML.NET and Azure Data Lake
 
ITCamp 2019 - Andy Cross - Business Outcomes from AI
ITCamp 2019 - Andy Cross - Business Outcomes from AIITCamp 2019 - Andy Cross - Business Outcomes from AI
ITCamp 2019 - Andy Cross - Business Outcomes from AI
 
ITCamp 2019 - Andrea Saltarello - Modernise your app. The Cloud Story
ITCamp 2019 - Andrea Saltarello - Modernise your app. The Cloud StoryITCamp 2019 - Andrea Saltarello - Modernise your app. The Cloud Story
ITCamp 2019 - Andrea Saltarello - Modernise your app. The Cloud Story
 
ITCamp 2019 - Andrea Saltarello - Implementing bots and Alexa skills using Az...
ITCamp 2019 - Andrea Saltarello - Implementing bots and Alexa skills using Az...ITCamp 2019 - Andrea Saltarello - Implementing bots and Alexa skills using Az...
ITCamp 2019 - Andrea Saltarello - Implementing bots and Alexa skills using Az...
 
ITCamp 2019 - Alex Mang - I'm Confused Should I Orchestrate my Containers on ...
ITCamp 2019 - Alex Mang - I'm Confused Should I Orchestrate my Containers on ...ITCamp 2019 - Alex Mang - I'm Confused Should I Orchestrate my Containers on ...
ITCamp 2019 - Alex Mang - I'm Confused Should I Orchestrate my Containers on ...
 
ITCamp 2019 - Alex Mang - How Far Can Serverless Actually Go Now
ITCamp 2019 - Alex Mang - How Far Can Serverless Actually Go NowITCamp 2019 - Alex Mang - How Far Can Serverless Actually Go Now
ITCamp 2019 - Alex Mang - How Far Can Serverless Actually Go Now
 
ITCamp 2019 - Peter Leeson - Vitruvian Quality
ITCamp 2019 - Peter Leeson - Vitruvian QualityITCamp 2019 - Peter Leeson - Vitruvian Quality
ITCamp 2019 - Peter Leeson - Vitruvian Quality
 
ITCamp 2018 - Ciprian Sorlea - Million Dollars Hello World Application
ITCamp 2018 - Ciprian Sorlea - Million Dollars Hello World ApplicationITCamp 2018 - Ciprian Sorlea - Million Dollars Hello World Application
ITCamp 2018 - Ciprian Sorlea - Million Dollars Hello World Application
 
ITCamp 2018 - Ciprian Sorlea - Enterprise Architectures with TypeScript And F...
ITCamp 2018 - Ciprian Sorlea - Enterprise Architectures with TypeScript And F...ITCamp 2018 - Ciprian Sorlea - Enterprise Architectures with TypeScript And F...
ITCamp 2018 - Ciprian Sorlea - Enterprise Architectures with TypeScript And F...
 

Último

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 

Último (20)

Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
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
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
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
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
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...
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
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...
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
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
 

Patterns for Scalability in Windows Azure Applications (Alex Mang)

  • 1. Premium community conference on Microsoft technologies itcampro@ itcamp14# Patterns for Scalability in Microsoft Azure Applications Alex Mang http://alexmang.ro @mangalexandru
  • 2. Premium community conference on Microsoft technologies itcampro@ itcamp14# Huge thanks to our sponsors & partners!
  • 3. Premium community conference on Microsoft technologies itcampro@ itcamp14#
  • 4. Premium community conference on Microsoft technologies itcampro@ itcamp14# • Alex Mang • CEO @ KeyTicket Solutions –Microsoft BizSpark Plus • Azure Advisor • MS, MCP, MCSD Speaker.Bio.ToString()
  • 5. Premium community conference on Microsoft technologies itcampro@ itcamp14# • Common requirements for cloud apps: –Availability –Data management –Design and implementation –Messaging –Management and monitoring –Performance and scalability –Resiliency –Security What are patterns?
  • 6. Premium community conference on Microsoft technologies itcampro@ itcamp14# • Performance –‘indication of responsiveness of a system to execute any action within a given time interval’ • Scalability –‘ability of a system to handle increases in load without impact on performance’ Performance and Scalability Patterns = ??? = ???
  • 7. Premium community conference on Microsoft technologies itcampro@ itcamp14# Performance and Scalability Patterns Cache-aside Competing consumersCQRS Event sourcing Index table Materialized view Priority Queue Queue based load leveling Sharding Static content Throttling
  • 8. Premium community conference on Microsoft technologies itcampro@ itcamp14# QUEUE-BASED LOAD LEVELING PATTERN
  • 9. Premium community conference on Microsoft technologies itcampro@ itcamp14# Queue-Based Load Leveling Pattern (Context) • Cloud app require external services • High load on cloud app means high load on services • External services may be less scalable • High load on cloud app could result in failing external services • Possible self-throttling
  • 10. Premium community conference on Microsoft technologies itcampro@ itcamp14# Queue-Based Load Leveling Pattern (Solution) • Force the processing of request inside a queue • Thus, load-leveled service requests • Additional advantage: queue also works as a buffer
  • 11. Premium community conference on Microsoft technologies itcampro@ itcamp14# Queue-Based Load Leveling Pattern (Solution)
  • 12. Premium community conference on Microsoft technologies itcampro@ itcamp14# Queue-Based Load Leveling Pattern (Consid.) • Make sure services are scaled correctly • Task senders may wait service replies
  • 13. Premium community conference on Microsoft technologies itcampro@ itcamp14# COMPETING CONSUMERS PATTERN
  • 14. Premium community conference on Microsoft technologies itcampro@ itcamp14# • Asynchronously process requests • The number of concurrent requests over time varies • The time required for processing varies Competing Consumers Pattern (Context)
  • 15. Premium community conference on Microsoft technologies itcampro@ itcamp14# Competing Consumers Pattern (Solution)
  • 16. Premium community conference on Microsoft technologies itcampro@ itcamp14# Competing Consumers Pattern (Considerations) • Ordering • Poisoned messages • Result handling • Message queue scaling • Reliability
  • 17. Premium community conference on Microsoft technologies itcampro@ itcamp14# PRIORITY QUEUE PATTERN
  • 18. Premium community conference on Microsoft technologies itcampro@ itcamp14# • Asynchronous processing via queues –Queues can’t sort messages (most of the times) • Push notification (15K) vs. e-mail (15K) Priority Queue Pattern (Context)
  • 19. Premium community conference on Microsoft technologies itcampro@ itcamp14# • Queues with different priorities • Consumers based on queue priority Priority Queue Pattern (Solution)
  • 20. Premium community conference on Microsoft technologies itcampro@ itcamp14# Priority Queue Pattern (Solution)
  • 21. Premium community conference on Microsoft technologies itcampro@ itcamp14# Priority Queue Pattern (Considerations) • What is ‘high priority’ vs ‘low priority’ • (Single pool consumers) high first, low after • (Single pool consumers) elevate old messages • Multiple queues work best for less priority definitions
  • 22. Premium community conference on Microsoft technologies itcampro@ itcamp14# Priority Queue Pattern (When To Use) Push first, send after example Multi-tenant applications Different SLAs / customers
  • 23. Premium community conference on Microsoft technologies itcampro@ itcamp14# Priority Queue Pattern (When NOT To Use) Messages have similar priority No burst of messages in the queue ever exists Costs must be kept down
  • 24. Premium community conference on Microsoft technologies itcampro@ itcamp14# DEMO PRIORITY QUEUE PATTERN
  • 25. Premium community conference on Microsoft technologies itcampro@ itcamp14# THROTTLING PATTERN
  • 26. Premium community conference on Microsoft technologies itcampro@ itcamp14# Throttling Pattern (Context) • Cloud application load varies –# active users (mostly during work hours) –Type of activities (analysis at end of month) • Sudden unanticipated bursts –Poor performance –Eventual failures • SLA requirements
  • 27. Premium community conference on Microsoft technologies itcampro@ itcamp14# Throttling Pattern (Solution) • Auto-scaling, for starters… • Define resource soft limits • Monitor resource usage • Throttle users –Based on business impact (tiers / plans) –Based on users’ concurrent requests • Degrade functionality • Load-leveling pattern / priority-queue pattern
  • 28. Premium community conference on Microsoft technologies itcampro@ itcamp14# Throttling Pattern (Solution)
  • 29. Premium community conference on Microsoft technologies itcampro@ itcamp14# Throttling Pattern (Solution)
  • 30. Premium community conference on Microsoft technologies itcampro@ itcamp14# Throttling Pattern (Considerations) • Architectural decision: consider it while designing • Quick monitoring technique • Notify accordingly
  • 31. Premium community conference on Microsoft technologies itcampro@ itcamp14# Throttling Pattern (When To Use) • Meet SLA • Prevent single user monopolize everything • Gracefully handle activity bursts • Control costs by limiting max. resource usage
  • 32. Premium community conference on Microsoft technologies itcampro@ itcamp14# DEMO THROTTLING PATTERN
  • 33. Premium community conference on Microsoft technologies itcampro@ itcamp14# Throttling Pattern (Demo)
  • 34. Premium community conference on Microsoft technologies itcampro@ itcamp14# MATERIALIZED VIEW PATTERN
  • 35. Premium community conference on Microsoft technologies itcampro@ itcamp14# • Most developers think about how data is stored • In NoSQL, we usually store everything in a single entity • In SQL, we have size constraints • End-up in: –Performance impact –High prices Materialized View Pattern (Context)
  • 36. Premium community conference on Microsoft technologies itcampro@ itcamp14# • 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 query • Updated a.s.a.p. (schedule / triggered) Materialized View Pattern (Solution)
  • 37. Premium community conference on Microsoft technologies itcampro@ itcamp14# Materialized View Pattern (Solution)
  • 38. Premium community conference on Microsoft technologies itcampro@ itcamp14# 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 Security or privacy reasons
  • 39. Premium community conference on Microsoft technologies itcampro@ itcamp14# Materialized View Pattern (When NOT To Use) Data source is simple to query Data changes quickly Consistency is most important
  • 40. Premium community conference on Microsoft technologies itcampro@ itcamp14# DEMO MATERIALIZED VIEW PATTERN
  • 41. Premium community conference on Microsoft technologies itcampro@ itcamp14# Materialized View Pattern (Demo)
  • 42. Premium community conference on Microsoft technologies itcampro@ itcamp14# COMMAND AND QUERY RESPONSIBILITY SEGREGATION PATTERN
  • 43. Premium community conference on Microsoft technologies itcampro@ itcamp14# CQRS Pattern (Context) • Traditional CRUD system do everything over the same data store • Typically, same entity for DB <--> UI <--> DB
  • 44. Premium community conference on Microsoft technologies itcampro@ itcamp14# CQRS Pattern (Context)
  • 45. Premium community conference on Microsoft technologies itcampro@ itcamp14# CQRS Pattern (Context) • Many concurrent connections  FAIL • Complex business logic  FAIL • Too much data passed around • Performance impact @ high load, due to complex querying • Security issues may arise
  • 46. Premium community conference on Microsoft technologies itcampro@ itcamp14# CQRS Pattern (Solution) • Segregate read (queries) from write (commands) • Models for querying and for updating are different • Possible to access same store, better not to
  • 47. Premium community conference on Microsoft technologies itcampro@ itcamp14# CQRS Pattern (Solution)
  • 48. Premium community conference on Microsoft technologies itcampro@ itcamp14# CQRS Pattern (Considerations) • Additional complexity • Consistency considerations • CQRS for parts of the application • Use in conjuction with Event Source pattern
  • 49. Premium community conference on Microsoft technologies itcampro@ itcamp14# CQRS Pattern (When To Use) Multiple concurrent operations Already familiar with Domain-Driven- Design techniques Read performance ≠ write performance Different teams (read vs. write) App. lifecycle: model update, business logic update
  • 50. Premium community conference on Microsoft technologies itcampro@ itcamp14# CQRS Pattern (When NOT To Use) Simple business rules Simple CRUD-style UI are enough Across the whole system
  • 51. Premium community conference on Microsoft technologies itcampro@ itcamp14# SHARDING PATTERN
  • 52. Premium community conference on Microsoft technologies itcampro@ itcamp14# Sharding Pattern (Context) • Why scale out compute, and not scale out data? • Must scale out data because: –Storage limitations –Concurrent requests –Network bandwidth –Geography
  • 53. Premium community conference on Microsoft technologies itcampro@ itcamp14# Sharding Pattern (Solution) • Horizontal partitions of data –(a.k.a. shards) • Same schema, different data • Runs on its own server • Benefits: –Scale out data service –Use commodity hardware –Better performance –Closely located geographically
  • 54. Premium community conference on Microsoft technologies itcampro@ itcamp14# Sharding Pattern (Solution) • Lookup strategy• Range strategy• Hash strategy
  • 55. Premium community conference on Microsoft technologies itcampro@ itcamp14# 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 (Solution)
  • 56. Premium community conference on Microsoft technologies itcampro@ itcamp14# THANK YOU!
  • 57. Premium community conference on Microsoft technologies itcampro@ itcamp14# Q & A