SlideShare una empresa de Scribd logo
1 de 56
Azure Cloud Patterns
About Me
• Software architect, consultant and instructor
• Software Engineering Lecturer @ Ruppin Academic Center
• Technology addict
• .NET and Native Windows Programming
@tamir_dresher
tamirdr@codevalue.net
http://www.TamirDresher.com.
Cloud Patterns
http://en.wikipedia.org/wiki/List_of_cloud_types
Agenda
• What are Cloud Patterns
• Queue Centric
• Poison Messages
• Retry Logic
• Circuit Breaker
• Cache Aside
What are Cloud Patterns
• Architectural Patterns:
“A design pattern in architecture and 
computer science is a formal way of 
documenting a solution to a design problem 
in a particular field of expertise”
(http://en.wikipedia.org/wiki/Architectural_patterns)
Meet The Problem
DevGeek Coffee Shop
DevGeek Coffee Shop
• DevGeek Coffee is a well known and
established coffee shop
• In business for 20 years
• Lately, with the increasing competition,
sales are dropping
• Lets Help!
DevGeek Coffee Shop - Operations
coffee
DevGeek Coffee Shop - Operations
coffee#!$@
What does this has to do with software?
• Cashier == Server
• Basically, this is a scalability issue
• Running in the cloud (potentially) makes
scaling problem appear faster
Scale Up
• Add More Resources to a Node
• Faster cashier
– Better CPU to the server
– More Memory
• Faster Coffee machine
– Use a better algorithm/service
Everything has a limit
MoneyMoney
CPUCPU
MEMMEMBANDWIDTH
BANDWIDTH
StorageStorage
Scale out
• Add More Nodes
– More Cashiers
• Load Distribution
– Round Robin
– Performance
– Other (location, expertise, etc)
Azure Traffic Manager
Meet The Problem 2
DevGeek Coffee Shop
DevGeek Coffee Shop – The clients complaints
• Long standing
• Sometimes orders gets lost
• Sometimes the line is so long that the
workers close the doors
DevGeek Coffee Shop – Latency and throughput
• Latency is a time interval between the
stimulation and response
– Time between ordering and receiving the coffee
• Throughput is the number of requests that
can be served per unit time
DevGeek Coffee Shop – Aroma model
coffee
.
Message Centric
Web Sites worker role
:
:
worker roleweb role
Message Centric – Load Leveling
:
:
Request Received at
variable rate
Messages Processed
at consistent rate
Message Centric – Resilency
:
:
X
X
Message Centric – Delayed Processing
:
:
Azure Queuing Options
• Azure Storage Queues
– Simple, Reliable, Persistent Queue
– Max 200TB and 7 days TTL per message
• Azure Service Bus
– Broader capabilities: publish/subscribe,
remoting, integration patterns
– Max 80GB and unlimited TTL per message
http://msdn.microsoft.com/en-us/library/hh767287.aspx
Azure Service Bus – Queueing
Service Bus Messaging - Queue
• Two parts:
1. key/value properties
2. binary message body.
• Example: a sales application
sends message
properties: 
• *Seller="Ava"  
• *Amount=10000.
• body : The sale's signed contract scanned image
Producer Consumer
Demo
C2
2
1
2
1
1
1
1
1
Removing Poison Messages
1
1
1
1
2
1
2
1
334
0
4
0
Producers Consumers
3
0
3
0
2. GetMessage(Q, 30 s)  msg 2
1. GetMessage(Q, 30 s)  msg 1
1
1
1
1
2
1
2
1
1
0
1
0
2
0
2
0
P2
P1
C1
C2
P2
P1
C1
Removing Poison Messages
34
0
4
0
Producers Consumers
1
1
1
1
2
1
2
1
2. GetMessage(Q, 30 s)  msg 2
3. C2 consumed msg 2
4. DeleteMessage(Q, msg 2)
7. GetMessage(Q, 30 s)  msg 1
1. GetMessage(Q, 30 s)  msg 1
5. C1 crashed
1
1
1
1
2
1
2
1
6. msg1 visible 30 s after Dequeue3
0
3
0
1
2
1
2
1
1
1
1
1
2
1
2
C2
P2
P1
C1
Removing Poison Messages
34
0
4
0
Producers Consumers
1
2
1
2
2. Dequeue(Q, 30 sec)  msg 2
3. C2 consumed msg 2
4. Delete(Q, msg 2)
7. Dequeue(Q, 30 sec)  msg 1
8. C2 crashed
1. Dequeue(Q, 30 sec)  msg 1
5. C1 crashed
10. C1 restarted
11. Dequeue(Q, 30 sec)  msg 1
12. DeliveryCount > 2
13. msg1.DeadLetter
1
2
1
2
6. msg1 visible 30s after Dequeue
9. msg1 visible 30s after Dequeue
3
0
3
0
1
3
1
3
1
2
1
2
1
3
1
3
Service Bus Messaging – Dead letters
• the name of the sub-queue is [queueName]/
$DeadLetterQueue
• The path can be obtained using the
FormatDeadLetterPath method of the
QueueClient
• Can be consumed by any other consumer
and check the messages, log them etc.
Priority Queue
• The queue may hold message with different
priorities (3-High, 1-Low)
Web Sites
worker role
:
:
worker roleweb role
:
Priority Queue
Application
Priority Queue
Application
Meet The Problem 3
DevGeek Coffee Shop
DevGeek Coffee Shop – The clients complaints
1. Sometimes the soy milk ran out
2. the barista calls to the storeroom
3. The line is busy
4. The barista move to next order
5. Customer receive an order cancellation
Transient Faults
• “Transient fault is a fault that is no longer
present if power is disconnected for a short
time and then restored.” (http
://en.wikipedia.org/wiki/Transient_fault#Transient_fault)
• Many faults in connectivity to cloud are
transient by nature
• Commonly occur when connecting to
service or database
Retry Pattern
• If at first you don’t succeed, try try again
(William Edward Hickson)
• Retry Logic
– Linear – every fixed amount of time
– Exponential – if the server is heavy-used
(throttling) we don’t want to flood it
immediate….1 sec….5 seconds….etc.
– Other
Operation With Basic Retry
    int currentRetry = 0;
    while (currentRetry < MaxRetries)
    {
        try
        {
            // Calling external service.
            await TransientOperationAsync();
        }
        catch (Exception ex)
        {
            currentRetry++;
 
            // Check if the exception thrown was a transient exception
            if (!IsTransient(ex))
            {
                // If this is not a transient error 
                // or we should not retry re-throw the exception. 
                throw;
            }
        } 
        await Task.Delay(TimeBetweenRetries);
    }
Retry Pattern – Solutions
• Azure Storage IRetryPolicy
• Azure Service Bus RetryPolicy
IRetryPolicy noRetryPolicy = new NoRetry();
BlobRequestOptions requestOptions = new
BlobRequestOptions()
{
RetryPolicy = noRetryPolicy,
};
MessagingFactory factory = MessagingFactory.Create();
factory.RetryPolicy = RetryExponential.Default;
factory.RetryPolicy = RetryPolicy.NoRetry;
The Transient Fault Handling Application Block
var retryPolicy =
new Incremental(5, TimeSpan.FromSeconds(1), TimeSpan.FromSeconds(2));
retryPolicy.Retrying += (sender, args) => {
Trace.WriteLine(args.LastException, "Information");
};
try {
retryPolicy.ExecuteAction(() =>
{
TranisentErrorOperation();
});
}
catch (Exception) {
// All the retries failed.
}
http://msdn.microsoft.com/en-us/library/hh680934(v=pandp.50).aspx
Circuit Breaker
Retry Logic – Not Always Not all The time
• Baristas keeps retrying/failing – Time
Consuming
• Maybe we can call someone else?
• The remote service still might get flooded
• If a failure is not transient, we wish that next
attempts fail immediately
Circuit Breaker
• Circuit Breaker pattern prevent repeatedly
trying to execute an operation that is likely
to fail
• continue without waiting for the fault to be
rectified
• Prevents wasting valuable resources
because of the wait
Circuit Breaker
• The Circuit Breaker is a proxy
• Monitor the number of recent failures
• Decide if to proceed or do something else
– Throw exception
– Try different destination
Circuit Breaker States
Closed Open
Success
Fail [threshold reached]
Half
Open
Retry Timeout
Fail
Success
Fail [under threshold]
Cache Aside
Deja vu
• We fetch the same data
• We run the same calculation
• We query the same service
Cache Aside
Azure Caching
• Azure Managed Cache
• Azure Redis Cache
• In-Role Cache
In Role Cache – co-located
In Role Cache - Dedicated
InRole Cache
Summery
• What are Cloud Patterns
• Queue Centric
• Poison Messages
• Retry Logic
• Circuit Breaker
• Cache Aside
References
• P&P Cloud Design Patterns -
http://msdn.microsoft.com/en-us/library/dn568099.aspx
• http://cloudpatterns.org/
• Cloud Architecture Patterns
Images References
1. http://en.wikipedia.org/wiki/List_of_cloud_types
2. http://www.freedigitalphotos.net/images/Emotions_g96-
Arms_Up_Character_Shows_Shock_And_Surprise_p142355.html
3. http://www.freedigitalphotos.net/images/Hot_drinks_g184-
Coffee_In_White_Cup_p96634.html

Más contenido relacionado

La actualidad más candente

GWAB 2015 - Data Plaraform
GWAB 2015 - Data PlaraformGWAB 2015 - Data Plaraform
GWAB 2015 - Data PlaraformMarcelo Paiva
 
Software Development with Apache Cassandra
Software Development with Apache CassandraSoftware Development with Apache Cassandra
Software Development with Apache Cassandrazznate
 
Getting Started with MariaDB with Docker
Getting Started with MariaDB with DockerGetting Started with MariaDB with Docker
Getting Started with MariaDB with DockerMariaDB plc
 
Applications of Virtual Machine Monitors for Scalable, Reliable, and Interact...
Applications of Virtual Machine Monitors for Scalable, Reliable, and Interact...Applications of Virtual Machine Monitors for Scalable, Reliable, and Interact...
Applications of Virtual Machine Monitors for Scalable, Reliable, and Interact...Amr Awadallah
 
Distributed applications using Hazelcast
Distributed applications using HazelcastDistributed applications using Hazelcast
Distributed applications using HazelcastTaras Matyashovsky
 
From cache to in-memory data grid. Introduction to Hazelcast.
From cache to in-memory data grid. Introduction to Hazelcast.From cache to in-memory data grid. Introduction to Hazelcast.
From cache to in-memory data grid. Introduction to Hazelcast.Taras Matyashovsky
 
Introduction to hazelcast
Introduction to hazelcastIntroduction to hazelcast
Introduction to hazelcastEmin Demirci
 
High Performance Computing - Cloud Point of View
High Performance Computing - Cloud Point of ViewHigh Performance Computing - Cloud Point of View
High Performance Computing - Cloud Point of Viewaragozin
 
Overcoming the Top Four Challenges to Real-Time Performance in Large-Scale, D...
Overcoming the Top Four Challenges to Real-Time Performance in Large-Scale, D...Overcoming the Top Four Challenges to Real-Time Performance in Large-Scale, D...
Overcoming the Top Four Challenges to Real-Time Performance in Large-Scale, D...SL Corporation
 
Virtualizing Latency Sensitive Workloads and vFabric GemFire
Virtualizing Latency Sensitive Workloads and vFabric GemFireVirtualizing Latency Sensitive Workloads and vFabric GemFire
Virtualizing Latency Sensitive Workloads and vFabric GemFireCarter Shanklin
 
Tarabica 2019 (Belgrade, Serbia) - SQL Server performance troubleshooting
Tarabica 2019 (Belgrade, Serbia) - SQL Server performance troubleshootingTarabica 2019 (Belgrade, Serbia) - SQL Server performance troubleshooting
Tarabica 2019 (Belgrade, Serbia) - SQL Server performance troubleshootingJovan Popovic
 
DV01 Ten Things You Always Wanted to Know About Windows Azure But Were Afraid...
DV01 Ten Things You Always Wanted to Know About Windows Azure But Were Afraid...DV01 Ten Things You Always Wanted to Know About Windows Azure But Were Afraid...
DV01 Ten Things You Always Wanted to Know About Windows Azure But Were Afraid...Ronald Widha
 
Ari Zilka Cluster Architecture Patterns
Ari Zilka Cluster Architecture PatternsAri Zilka Cluster Architecture Patterns
Ari Zilka Cluster Architecture Patternsdeimos
 
Scaling data on public clouds
Scaling data on public cloudsScaling data on public clouds
Scaling data on public cloudsLiran Zelkha
 
Client Drivers and Cassandra, the Right Way
Client Drivers and Cassandra, the Right WayClient Drivers and Cassandra, the Right Way
Client Drivers and Cassandra, the Right WayDataStax Academy
 
Object oriented design patterns for distributed systems
Object oriented design patterns for distributed systemsObject oriented design patterns for distributed systems
Object oriented design patterns for distributed systemsJordan McBain
 
Using all of the high availability options in MariaDB
Using all of the high availability options in MariaDBUsing all of the high availability options in MariaDB
Using all of the high availability options in MariaDBMariaDB plc
 
Dr and ha solutions with sql server azure
Dr and ha solutions with sql server azureDr and ha solutions with sql server azure
Dr and ha solutions with sql server azureMSDEVMTL
 

La actualidad más candente (20)

GWAB 2015 - Data Plaraform
GWAB 2015 - Data PlaraformGWAB 2015 - Data Plaraform
GWAB 2015 - Data Plaraform
 
Software Development with Apache Cassandra
Software Development with Apache CassandraSoftware Development with Apache Cassandra
Software Development with Apache Cassandra
 
Getting Started with MariaDB with Docker
Getting Started with MariaDB with DockerGetting Started with MariaDB with Docker
Getting Started with MariaDB with Docker
 
Oracle Coherence
Oracle CoherenceOracle Coherence
Oracle Coherence
 
Applications of Virtual Machine Monitors for Scalable, Reliable, and Interact...
Applications of Virtual Machine Monitors for Scalable, Reliable, and Interact...Applications of Virtual Machine Monitors for Scalable, Reliable, and Interact...
Applications of Virtual Machine Monitors for Scalable, Reliable, and Interact...
 
Distributed applications using Hazelcast
Distributed applications using HazelcastDistributed applications using Hazelcast
Distributed applications using Hazelcast
 
From cache to in-memory data grid. Introduction to Hazelcast.
From cache to in-memory data grid. Introduction to Hazelcast.From cache to in-memory data grid. Introduction to Hazelcast.
From cache to in-memory data grid. Introduction to Hazelcast.
 
Introduction to hazelcast
Introduction to hazelcastIntroduction to hazelcast
Introduction to hazelcast
 
High Performance Computing - Cloud Point of View
High Performance Computing - Cloud Point of ViewHigh Performance Computing - Cloud Point of View
High Performance Computing - Cloud Point of View
 
Overcoming the Top Four Challenges to Real-Time Performance in Large-Scale, D...
Overcoming the Top Four Challenges to Real-Time Performance in Large-Scale, D...Overcoming the Top Four Challenges to Real-Time Performance in Large-Scale, D...
Overcoming the Top Four Challenges to Real-Time Performance in Large-Scale, D...
 
Virtualizing Latency Sensitive Workloads and vFabric GemFire
Virtualizing Latency Sensitive Workloads and vFabric GemFireVirtualizing Latency Sensitive Workloads and vFabric GemFire
Virtualizing Latency Sensitive Workloads and vFabric GemFire
 
Tarabica 2019 (Belgrade, Serbia) - SQL Server performance troubleshooting
Tarabica 2019 (Belgrade, Serbia) - SQL Server performance troubleshootingTarabica 2019 (Belgrade, Serbia) - SQL Server performance troubleshooting
Tarabica 2019 (Belgrade, Serbia) - SQL Server performance troubleshooting
 
DV01 Ten Things You Always Wanted to Know About Windows Azure But Were Afraid...
DV01 Ten Things You Always Wanted to Know About Windows Azure But Were Afraid...DV01 Ten Things You Always Wanted to Know About Windows Azure But Were Afraid...
DV01 Ten Things You Always Wanted to Know About Windows Azure But Were Afraid...
 
Ari Zilka Cluster Architecture Patterns
Ari Zilka Cluster Architecture PatternsAri Zilka Cluster Architecture Patterns
Ari Zilka Cluster Architecture Patterns
 
Scaling data on public clouds
Scaling data on public cloudsScaling data on public clouds
Scaling data on public clouds
 
Client Drivers and Cassandra, the Right Way
Client Drivers and Cassandra, the Right WayClient Drivers and Cassandra, the Right Way
Client Drivers and Cassandra, the Right Way
 
Object oriented design patterns for distributed systems
Object oriented design patterns for distributed systemsObject oriented design patterns for distributed systems
Object oriented design patterns for distributed systems
 
Using all of the high availability options in MariaDB
Using all of the high availability options in MariaDBUsing all of the high availability options in MariaDB
Using all of the high availability options in MariaDB
 
Dr and ha solutions with sql server azure
Dr and ha solutions with sql server azureDr and ha solutions with sql server azure
Dr and ha solutions with sql server azure
 
Virtualization vs. Cloud Computing: What's the Difference?
Virtualization vs. Cloud Computing: What's the Difference?Virtualization vs. Cloud Computing: What's the Difference?
Virtualization vs. Cloud Computing: What's the Difference?
 

Similar a Azure Cloud Patterns

Exploring Twitter's Finagle technology stack for microservices
Exploring Twitter's Finagle technology stack for microservicesExploring Twitter's Finagle technology stack for microservices
Exploring Twitter's Finagle technology stack for microservices💡 Tomasz Kogut
 
Polyglot and Poly-paradigm Programming for Better Agility
Polyglot and Poly-paradigm Programming for Better AgilityPolyglot and Poly-paradigm Programming for Better Agility
Polyglot and Poly-paradigm Programming for Better Agilityelliando dias
 
Expect the unexpected: Prepare for failures in microservices
Expect the unexpected: Prepare for failures in microservicesExpect the unexpected: Prepare for failures in microservices
Expect the unexpected: Prepare for failures in microservicesBhakti Mehta
 
Azure architecture design patterns - proven solutions to common challenges
Azure architecture design patterns - proven solutions to common challengesAzure architecture design patterns - proven solutions to common challenges
Azure architecture design patterns - proven solutions to common challengesIvo Andreev
 
Resilience Planning & How the Empire Strikes Back
Resilience Planning & How the Empire Strikes BackResilience Planning & How the Empire Strikes Back
Resilience Planning & How the Empire Strikes BackC4Media
 
Celery: The Distributed Task Queue
Celery: The Distributed Task QueueCelery: The Distributed Task Queue
Celery: The Distributed Task QueueRichard Leland
 
Scaling habits of ASP.NET
Scaling habits of ASP.NETScaling habits of ASP.NET
Scaling habits of ASP.NETDavid Giard
 
6 tips for improving ruby performance
6 tips for improving ruby performance6 tips for improving ruby performance
6 tips for improving ruby performanceEngine Yard
 
DjangoCon 2010 Scaling Disqus
DjangoCon 2010 Scaling DisqusDjangoCon 2010 Scaling Disqus
DjangoCon 2010 Scaling Disquszeeg
 
Cloud patterns - NDC Oslo 2016 - Tamir Dresher
Cloud patterns - NDC Oslo 2016 - Tamir DresherCloud patterns - NDC Oslo 2016 - Tamir Dresher
Cloud patterns - NDC Oslo 2016 - Tamir DresherTamir Dresher
 
MySQL Performance Tuning at COSCUP 2014
MySQL Performance Tuning at COSCUP 2014MySQL Performance Tuning at COSCUP 2014
MySQL Performance Tuning at COSCUP 2014Ryusuke Kajiyama
 
Production Ready Microservices at Scale
Production Ready Microservices at ScaleProduction Ready Microservices at Scale
Production Ready Microservices at ScaleRajeev Bharshetty
 
When it Absolutely, Positively, Has to be There: Reliability Guarantees in Ka...
When it Absolutely, Positively, Has to be There: Reliability Guarantees in Ka...When it Absolutely, Positively, Has to be There: Reliability Guarantees in Ka...
When it Absolutely, Positively, Has to be There: Reliability Guarantees in Ka...confluent
 
The Diabolical Developers Guide to Performance Tuning
The Diabolical Developers Guide to Performance TuningThe Diabolical Developers Guide to Performance Tuning
The Diabolical Developers Guide to Performance TuningjClarity
 
Resilience planning and how the empire strikes back
Resilience planning and how the empire strikes backResilience planning and how the empire strikes back
Resilience planning and how the empire strikes backBhakti Mehta
 
Automated product categorization
Automated product categorizationAutomated product categorization
Automated product categorizationAndreas Loupasakis
 
Automated product categorization
Automated product categorization   Automated product categorization
Automated product categorization Warply
 
Architecting for the cloud elasticity security
Architecting for the cloud elasticity securityArchitecting for the cloud elasticity security
Architecting for the cloud elasticity securityLen Bass
 

Similar a Azure Cloud Patterns (20)

Exploring Twitter's Finagle technology stack for microservices
Exploring Twitter's Finagle technology stack for microservicesExploring Twitter's Finagle technology stack for microservices
Exploring Twitter's Finagle technology stack for microservices
 
Polyglot and Poly-paradigm Programming for Better Agility
Polyglot and Poly-paradigm Programming for Better AgilityPolyglot and Poly-paradigm Programming for Better Agility
Polyglot and Poly-paradigm Programming for Better Agility
 
Expect the unexpected: Prepare for failures in microservices
Expect the unexpected: Prepare for failures in microservicesExpect the unexpected: Prepare for failures in microservices
Expect the unexpected: Prepare for failures in microservices
 
Azure architecture design patterns - proven solutions to common challenges
Azure architecture design patterns - proven solutions to common challengesAzure architecture design patterns - proven solutions to common challenges
Azure architecture design patterns - proven solutions to common challenges
 
Resilience Planning & How the Empire Strikes Back
Resilience Planning & How the Empire Strikes BackResilience Planning & How the Empire Strikes Back
Resilience Planning & How the Empire Strikes Back
 
Celery: The Distributed Task Queue
Celery: The Distributed Task QueueCelery: The Distributed Task Queue
Celery: The Distributed Task Queue
 
Scaling habits of ASP.NET
Scaling habits of ASP.NETScaling habits of ASP.NET
Scaling habits of ASP.NET
 
6 tips for improving ruby performance
6 tips for improving ruby performance6 tips for improving ruby performance
6 tips for improving ruby performance
 
DjangoCon 2010 Scaling Disqus
DjangoCon 2010 Scaling DisqusDjangoCon 2010 Scaling Disqus
DjangoCon 2010 Scaling Disqus
 
Cloud patterns - NDC Oslo 2016 - Tamir Dresher
Cloud patterns - NDC Oslo 2016 - Tamir DresherCloud patterns - NDC Oslo 2016 - Tamir Dresher
Cloud patterns - NDC Oslo 2016 - Tamir Dresher
 
Effective SOA
Effective SOAEffective SOA
Effective SOA
 
MySQL Performance Tuning at COSCUP 2014
MySQL Performance Tuning at COSCUP 2014MySQL Performance Tuning at COSCUP 2014
MySQL Performance Tuning at COSCUP 2014
 
Production Ready Microservices at Scale
Production Ready Microservices at ScaleProduction Ready Microservices at Scale
Production Ready Microservices at Scale
 
When it Absolutely, Positively, Has to be There: Reliability Guarantees in Ka...
When it Absolutely, Positively, Has to be There: Reliability Guarantees in Ka...When it Absolutely, Positively, Has to be There: Reliability Guarantees in Ka...
When it Absolutely, Positively, Has to be There: Reliability Guarantees in Ka...
 
The Diabolical Developers Guide to Performance Tuning
The Diabolical Developers Guide to Performance TuningThe Diabolical Developers Guide to Performance Tuning
The Diabolical Developers Guide to Performance Tuning
 
Scaling tappsi
Scaling tappsiScaling tappsi
Scaling tappsi
 
Resilience planning and how the empire strikes back
Resilience planning and how the empire strikes backResilience planning and how the empire strikes back
Resilience planning and how the empire strikes back
 
Automated product categorization
Automated product categorizationAutomated product categorization
Automated product categorization
 
Automated product categorization
Automated product categorization   Automated product categorization
Automated product categorization
 
Architecting for the cloud elasticity security
Architecting for the cloud elasticity securityArchitecting for the cloud elasticity security
Architecting for the cloud elasticity security
 

Más de Tamir Dresher

NET Aspire - NET Conf IL 2024 - Tamir Dresher.pdf
NET Aspire - NET Conf IL 2024 - Tamir Dresher.pdfNET Aspire - NET Conf IL 2024 - Tamir Dresher.pdf
NET Aspire - NET Conf IL 2024 - Tamir Dresher.pdfTamir Dresher
 
Tamir Dresher - DotNet 7 What's new.pptx
Tamir Dresher - DotNet 7 What's new.pptxTamir Dresher - DotNet 7 What's new.pptx
Tamir Dresher - DotNet 7 What's new.pptxTamir Dresher
 
Tamir Dresher - What’s new in ASP.NET Core 6
Tamir Dresher - What’s new in ASP.NET Core 6Tamir Dresher - What’s new in ASP.NET Core 6
Tamir Dresher - What’s new in ASP.NET Core 6Tamir Dresher
 
Tamir Dresher - Async Streams in C#
Tamir Dresher - Async Streams in C#Tamir Dresher - Async Streams in C#
Tamir Dresher - Async Streams in C#Tamir Dresher
 
Anatomy of a data driven architecture - Tamir Dresher
Anatomy of a data driven architecture - Tamir Dresher   Anatomy of a data driven architecture - Tamir Dresher
Anatomy of a data driven architecture - Tamir Dresher Tamir Dresher
 
Tamir Dresher Clarizen adventures with the wild GC during the holiday season
Tamir Dresher   Clarizen adventures with the wild GC during the holiday seasonTamir Dresher   Clarizen adventures with the wild GC during the holiday season
Tamir Dresher Clarizen adventures with the wild GC during the holiday seasonTamir Dresher
 
Debugging tricks you wish you knew Tamir Dresher - Odessa 2019
Debugging tricks you wish you knew   Tamir Dresher - Odessa 2019Debugging tricks you wish you knew   Tamir Dresher - Odessa 2019
Debugging tricks you wish you knew Tamir Dresher - Odessa 2019Tamir Dresher
 
From zero to hero with the actor model - Tamir Dresher - Odessa 2019
From zero to hero with the actor model  - Tamir Dresher - Odessa 2019From zero to hero with the actor model  - Tamir Dresher - Odessa 2019
From zero to hero with the actor model - Tamir Dresher - Odessa 2019Tamir Dresher
 
Tamir Dresher - Demystifying the Core of .NET Core
Tamir Dresher  - Demystifying the Core of .NET CoreTamir Dresher  - Demystifying the Core of .NET Core
Tamir Dresher - Demystifying the Core of .NET CoreTamir Dresher
 
Breaking the monolith to microservice with Docker and Kubernetes (k8s)
Breaking the monolith to microservice with Docker and Kubernetes (k8s)Breaking the monolith to microservice with Docker and Kubernetes (k8s)
Breaking the monolith to microservice with Docker and Kubernetes (k8s)Tamir Dresher
 
.Net december 2017 updates - Tamir Dresher
.Net december 2017 updates - Tamir Dresher.Net december 2017 updates - Tamir Dresher
.Net december 2017 updates - Tamir DresherTamir Dresher
 
Testing time and concurrency Rx
Testing time and concurrency RxTesting time and concurrency Rx
Testing time and concurrency RxTamir Dresher
 
Building responsive application with Rx - confoo - tamir dresher
Building responsive application with Rx - confoo - tamir dresherBuilding responsive application with Rx - confoo - tamir dresher
Building responsive application with Rx - confoo - tamir dresherTamir Dresher
 
.NET Debugging tricks you wish you knew tamir dresher
.NET Debugging tricks you wish you knew   tamir dresher.NET Debugging tricks you wish you knew   tamir dresher
.NET Debugging tricks you wish you knew tamir dresherTamir Dresher
 
From Zero to the Actor Model (With Akka.Net) - CodeMash2017 - Tamir Dresher
From Zero to the Actor Model (With Akka.Net) - CodeMash2017 - Tamir DresherFrom Zero to the Actor Model (With Akka.Net) - CodeMash2017 - Tamir Dresher
From Zero to the Actor Model (With Akka.Net) - CodeMash2017 - Tamir DresherTamir Dresher
 
Building responsive applications with Rx - CodeMash2017 - Tamir Dresher
Building responsive applications with Rx  - CodeMash2017 - Tamir DresherBuilding responsive applications with Rx  - CodeMash2017 - Tamir Dresher
Building responsive applications with Rx - CodeMash2017 - Tamir DresherTamir Dresher
 
Debugging tricks you wish you knew - Tamir Dresher
Debugging tricks you wish you knew  - Tamir DresherDebugging tricks you wish you knew  - Tamir Dresher
Debugging tricks you wish you knew - Tamir DresherTamir Dresher
 
Rx 101 - Tamir Dresher - Copenhagen .NET User Group
Rx 101  - Tamir Dresher - Copenhagen .NET User GroupRx 101  - Tamir Dresher - Copenhagen .NET User Group
Rx 101 - Tamir Dresher - Copenhagen .NET User GroupTamir Dresher
 
Reactiveness All The Way - SW Architecture 2015 Conference
Reactiveness All The Way - SW Architecture 2015 ConferenceReactiveness All The Way - SW Architecture 2015 Conference
Reactiveness All The Way - SW Architecture 2015 ConferenceTamir Dresher
 
Rx 101 Codemotion Milan 2015 - Tamir Dresher
Rx 101   Codemotion Milan 2015 - Tamir DresherRx 101   Codemotion Milan 2015 - Tamir Dresher
Rx 101 Codemotion Milan 2015 - Tamir DresherTamir Dresher
 

Más de Tamir Dresher (20)

NET Aspire - NET Conf IL 2024 - Tamir Dresher.pdf
NET Aspire - NET Conf IL 2024 - Tamir Dresher.pdfNET Aspire - NET Conf IL 2024 - Tamir Dresher.pdf
NET Aspire - NET Conf IL 2024 - Tamir Dresher.pdf
 
Tamir Dresher - DotNet 7 What's new.pptx
Tamir Dresher - DotNet 7 What's new.pptxTamir Dresher - DotNet 7 What's new.pptx
Tamir Dresher - DotNet 7 What's new.pptx
 
Tamir Dresher - What’s new in ASP.NET Core 6
Tamir Dresher - What’s new in ASP.NET Core 6Tamir Dresher - What’s new in ASP.NET Core 6
Tamir Dresher - What’s new in ASP.NET Core 6
 
Tamir Dresher - Async Streams in C#
Tamir Dresher - Async Streams in C#Tamir Dresher - Async Streams in C#
Tamir Dresher - Async Streams in C#
 
Anatomy of a data driven architecture - Tamir Dresher
Anatomy of a data driven architecture - Tamir Dresher   Anatomy of a data driven architecture - Tamir Dresher
Anatomy of a data driven architecture - Tamir Dresher
 
Tamir Dresher Clarizen adventures with the wild GC during the holiday season
Tamir Dresher   Clarizen adventures with the wild GC during the holiday seasonTamir Dresher   Clarizen adventures with the wild GC during the holiday season
Tamir Dresher Clarizen adventures with the wild GC during the holiday season
 
Debugging tricks you wish you knew Tamir Dresher - Odessa 2019
Debugging tricks you wish you knew   Tamir Dresher - Odessa 2019Debugging tricks you wish you knew   Tamir Dresher - Odessa 2019
Debugging tricks you wish you knew Tamir Dresher - Odessa 2019
 
From zero to hero with the actor model - Tamir Dresher - Odessa 2019
From zero to hero with the actor model  - Tamir Dresher - Odessa 2019From zero to hero with the actor model  - Tamir Dresher - Odessa 2019
From zero to hero with the actor model - Tamir Dresher - Odessa 2019
 
Tamir Dresher - Demystifying the Core of .NET Core
Tamir Dresher  - Demystifying the Core of .NET CoreTamir Dresher  - Demystifying the Core of .NET Core
Tamir Dresher - Demystifying the Core of .NET Core
 
Breaking the monolith to microservice with Docker and Kubernetes (k8s)
Breaking the monolith to microservice with Docker and Kubernetes (k8s)Breaking the monolith to microservice with Docker and Kubernetes (k8s)
Breaking the monolith to microservice with Docker and Kubernetes (k8s)
 
.Net december 2017 updates - Tamir Dresher
.Net december 2017 updates - Tamir Dresher.Net december 2017 updates - Tamir Dresher
.Net december 2017 updates - Tamir Dresher
 
Testing time and concurrency Rx
Testing time and concurrency RxTesting time and concurrency Rx
Testing time and concurrency Rx
 
Building responsive application with Rx - confoo - tamir dresher
Building responsive application with Rx - confoo - tamir dresherBuilding responsive application with Rx - confoo - tamir dresher
Building responsive application with Rx - confoo - tamir dresher
 
.NET Debugging tricks you wish you knew tamir dresher
.NET Debugging tricks you wish you knew   tamir dresher.NET Debugging tricks you wish you knew   tamir dresher
.NET Debugging tricks you wish you knew tamir dresher
 
From Zero to the Actor Model (With Akka.Net) - CodeMash2017 - Tamir Dresher
From Zero to the Actor Model (With Akka.Net) - CodeMash2017 - Tamir DresherFrom Zero to the Actor Model (With Akka.Net) - CodeMash2017 - Tamir Dresher
From Zero to the Actor Model (With Akka.Net) - CodeMash2017 - Tamir Dresher
 
Building responsive applications with Rx - CodeMash2017 - Tamir Dresher
Building responsive applications with Rx  - CodeMash2017 - Tamir DresherBuilding responsive applications with Rx  - CodeMash2017 - Tamir Dresher
Building responsive applications with Rx - CodeMash2017 - Tamir Dresher
 
Debugging tricks you wish you knew - Tamir Dresher
Debugging tricks you wish you knew  - Tamir DresherDebugging tricks you wish you knew  - Tamir Dresher
Debugging tricks you wish you knew - Tamir Dresher
 
Rx 101 - Tamir Dresher - Copenhagen .NET User Group
Rx 101  - Tamir Dresher - Copenhagen .NET User GroupRx 101  - Tamir Dresher - Copenhagen .NET User Group
Rx 101 - Tamir Dresher - Copenhagen .NET User Group
 
Reactiveness All The Way - SW Architecture 2015 Conference
Reactiveness All The Way - SW Architecture 2015 ConferenceReactiveness All The Way - SW Architecture 2015 Conference
Reactiveness All The Way - SW Architecture 2015 Conference
 
Rx 101 Codemotion Milan 2015 - Tamir Dresher
Rx 101   Codemotion Milan 2015 - Tamir DresherRx 101   Codemotion Milan 2015 - Tamir Dresher
Rx 101 Codemotion Milan 2015 - Tamir Dresher
 

Último

Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Andreas Granig
 
Buds n Tech IT Solutions: Top-Notch Web Services in Noida
Buds n Tech IT Solutions: Top-Notch Web Services in NoidaBuds n Tech IT Solutions: Top-Notch Web Services in Noida
Buds n Tech IT Solutions: Top-Notch Web Services in Noidabntitsolutionsrishis
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesPhilip Schwarz
 
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Angel Borroy López
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024StefanoLambiase
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样umasea
 
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Natan Silnitsky
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEEVICTOR MAESTRE RAMIREZ
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based projectAnoyGreter
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaHanief Utama
 
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...confluent
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWave PLM
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtimeandrehoraa
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...Technogeeks
 
Xen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfXen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfStefano Stabellini
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanyChristoph Pohl
 
Best Web Development Agency- Idiosys USA.pdf
Best Web Development Agency- Idiosys USA.pdfBest Web Development Agency- Idiosys USA.pdf
Best Web Development Agency- Idiosys USA.pdfIdiosysTechnologies1
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxTier1 app
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsAhmed Mohamed
 

Último (20)

Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024
 
Buds n Tech IT Solutions: Top-Notch Web Services in Noida
Buds n Tech IT Solutions: Top-Notch Web Services in NoidaBuds n Tech IT Solutions: Top-Notch Web Services in Noida
Buds n Tech IT Solutions: Top-Notch Web Services in Noida
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a series
 
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
 
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEE
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based project
 
Advantages of Odoo ERP 17 for Your Business
Advantages of Odoo ERP 17 for Your BusinessAdvantages of Odoo ERP 17 for Your Business
Advantages of Odoo ERP 17 for Your Business
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief Utama
 
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need It
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtime
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...
 
Xen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfXen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdf
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
 
Best Web Development Agency- Idiosys USA.pdf
Best Web Development Agency- Idiosys USA.pdfBest Web Development Agency- Idiosys USA.pdf
Best Web Development Agency- Idiosys USA.pdf
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML Diagrams
 

Azure Cloud Patterns

  • 2. About Me • Software architect, consultant and instructor • Software Engineering Lecturer @ Ruppin Academic Center • Technology addict • .NET and Native Windows Programming @tamir_dresher tamirdr@codevalue.net http://www.TamirDresher.com.
  • 4. Agenda • What are Cloud Patterns • Queue Centric • Poison Messages • Retry Logic • Circuit Breaker • Cache Aside
  • 5. What are Cloud Patterns • Architectural Patterns: “A design pattern in architecture and  computer science is a formal way of  documenting a solution to a design problem  in a particular field of expertise” (http://en.wikipedia.org/wiki/Architectural_patterns)
  • 7. DevGeek Coffee Shop • DevGeek Coffee is a well known and established coffee shop • In business for 20 years • Lately, with the increasing competition, sales are dropping • Lets Help!
  • 8. DevGeek Coffee Shop - Operations coffee
  • 9. DevGeek Coffee Shop - Operations coffee#!$@
  • 10. What does this has to do with software? • Cashier == Server • Basically, this is a scalability issue • Running in the cloud (potentially) makes scaling problem appear faster
  • 11. Scale Up • Add More Resources to a Node • Faster cashier – Better CPU to the server – More Memory • Faster Coffee machine – Use a better algorithm/service
  • 12. Everything has a limit MoneyMoney CPUCPU MEMMEMBANDWIDTH BANDWIDTH StorageStorage
  • 13. Scale out • Add More Nodes – More Cashiers • Load Distribution – Round Robin – Performance – Other (location, expertise, etc)
  • 15. Meet The Problem 2 DevGeek Coffee Shop
  • 16. DevGeek Coffee Shop – The clients complaints • Long standing • Sometimes orders gets lost • Sometimes the line is so long that the workers close the doors
  • 17. DevGeek Coffee Shop – Latency and throughput • Latency is a time interval between the stimulation and response – Time between ordering and receiving the coffee • Throughput is the number of requests that can be served per unit time
  • 18. DevGeek Coffee Shop – Aroma model coffee .
  • 19. Message Centric Web Sites worker role : : worker roleweb role
  • 20. Message Centric – Load Leveling : : Request Received at variable rate Messages Processed at consistent rate
  • 21. Message Centric – Resilency : : X X
  • 22. Message Centric – Delayed Processing : :
  • 23. Azure Queuing Options • Azure Storage Queues – Simple, Reliable, Persistent Queue – Max 200TB and 7 days TTL per message • Azure Service Bus – Broader capabilities: publish/subscribe, remoting, integration patterns – Max 80GB and unlimited TTL per message http://msdn.microsoft.com/en-us/library/hh767287.aspx
  • 24. Azure Service Bus – Queueing
  • 25. Service Bus Messaging - Queue • Two parts: 1. key/value properties 2. binary message body. • Example: a sales application sends message properties:  • *Seller="Ava"   • *Amount=10000. • body : The sale's signed contract scanned image
  • 27. C2 2 1 2 1 1 1 1 1 Removing Poison Messages 1 1 1 1 2 1 2 1 334 0 4 0 Producers Consumers 3 0 3 0 2. GetMessage(Q, 30 s)  msg 2 1. GetMessage(Q, 30 s)  msg 1 1 1 1 1 2 1 2 1 1 0 1 0 2 0 2 0 P2 P1 C1
  • 28. C2 P2 P1 C1 Removing Poison Messages 34 0 4 0 Producers Consumers 1 1 1 1 2 1 2 1 2. GetMessage(Q, 30 s)  msg 2 3. C2 consumed msg 2 4. DeleteMessage(Q, msg 2) 7. GetMessage(Q, 30 s)  msg 1 1. GetMessage(Q, 30 s)  msg 1 5. C1 crashed 1 1 1 1 2 1 2 1 6. msg1 visible 30 s after Dequeue3 0 3 0 1 2 1 2 1 1 1 1 1 2 1 2
  • 29. C2 P2 P1 C1 Removing Poison Messages 34 0 4 0 Producers Consumers 1 2 1 2 2. Dequeue(Q, 30 sec)  msg 2 3. C2 consumed msg 2 4. Delete(Q, msg 2) 7. Dequeue(Q, 30 sec)  msg 1 8. C2 crashed 1. Dequeue(Q, 30 sec)  msg 1 5. C1 crashed 10. C1 restarted 11. Dequeue(Q, 30 sec)  msg 1 12. DeliveryCount > 2 13. msg1.DeadLetter 1 2 1 2 6. msg1 visible 30s after Dequeue 9. msg1 visible 30s after Dequeue 3 0 3 0 1 3 1 3 1 2 1 2 1 3 1 3
  • 30. Service Bus Messaging – Dead letters • the name of the sub-queue is [queueName]/ $DeadLetterQueue • The path can be obtained using the FormatDeadLetterPath method of the QueueClient • Can be consumed by any other consumer and check the messages, log them etc.
  • 31. Priority Queue • The queue may hold message with different priorities (3-High, 1-Low) Web Sites worker role : : worker roleweb role :
  • 34. Meet The Problem 3 DevGeek Coffee Shop
  • 35. DevGeek Coffee Shop – The clients complaints 1. Sometimes the soy milk ran out 2. the barista calls to the storeroom 3. The line is busy 4. The barista move to next order 5. Customer receive an order cancellation
  • 36. Transient Faults • “Transient fault is a fault that is no longer present if power is disconnected for a short time and then restored.” (http ://en.wikipedia.org/wiki/Transient_fault#Transient_fault) • Many faults in connectivity to cloud are transient by nature • Commonly occur when connecting to service or database
  • 37. Retry Pattern • If at first you don’t succeed, try try again (William Edward Hickson) • Retry Logic – Linear – every fixed amount of time – Exponential – if the server is heavy-used (throttling) we don’t want to flood it immediate….1 sec….5 seconds….etc. – Other
  • 38. Operation With Basic Retry     int currentRetry = 0;     while (currentRetry < MaxRetries)     {         try         {             // Calling external service.             await TransientOperationAsync();         }         catch (Exception ex)         {             currentRetry++;               // Check if the exception thrown was a transient exception             if (!IsTransient(ex))             {                 // If this is not a transient error                  // or we should not retry re-throw the exception.                  throw;             }         }          await Task.Delay(TimeBetweenRetries);     }
  • 39. Retry Pattern – Solutions • Azure Storage IRetryPolicy • Azure Service Bus RetryPolicy IRetryPolicy noRetryPolicy = new NoRetry(); BlobRequestOptions requestOptions = new BlobRequestOptions() { RetryPolicy = noRetryPolicy, }; MessagingFactory factory = MessagingFactory.Create(); factory.RetryPolicy = RetryExponential.Default; factory.RetryPolicy = RetryPolicy.NoRetry;
  • 40. The Transient Fault Handling Application Block var retryPolicy = new Incremental(5, TimeSpan.FromSeconds(1), TimeSpan.FromSeconds(2)); retryPolicy.Retrying += (sender, args) => { Trace.WriteLine(args.LastException, "Information"); }; try { retryPolicy.ExecuteAction(() => { TranisentErrorOperation(); }); } catch (Exception) { // All the retries failed. } http://msdn.microsoft.com/en-us/library/hh680934(v=pandp.50).aspx
  • 42. Retry Logic – Not Always Not all The time • Baristas keeps retrying/failing – Time Consuming • Maybe we can call someone else? • The remote service still might get flooded • If a failure is not transient, we wish that next attempts fail immediately
  • 43. Circuit Breaker • Circuit Breaker pattern prevent repeatedly trying to execute an operation that is likely to fail • continue without waiting for the fault to be rectified • Prevents wasting valuable resources because of the wait
  • 44. Circuit Breaker • The Circuit Breaker is a proxy • Monitor the number of recent failures • Decide if to proceed or do something else – Throw exception – Try different destination
  • 45. Circuit Breaker States Closed Open Success Fail [threshold reached] Half Open Retry Timeout Fail Success Fail [under threshold]
  • 47. Deja vu • We fetch the same data • We run the same calculation • We query the same service
  • 49. Azure Caching • Azure Managed Cache • Azure Redis Cache • In-Role Cache
  • 50. In Role Cache – co-located
  • 51. In Role Cache - Dedicated
  • 53. Summery • What are Cloud Patterns • Queue Centric • Poison Messages • Retry Logic • Circuit Breaker • Cache Aside
  • 54. References • P&P Cloud Design Patterns - http://msdn.microsoft.com/en-us/library/dn568099.aspx • http://cloudpatterns.org/ • Cloud Architecture Patterns
  • 55.
  • 56. Images References 1. http://en.wikipedia.org/wiki/List_of_cloud_types 2. http://www.freedigitalphotos.net/images/Emotions_g96- Arms_Up_Character_Shows_Shock_And_Surprise_p142355.html 3. http://www.freedigitalphotos.net/images/Hot_drinks_g184- Coffee_In_White_Cup_p96634.html