SlideShare a Scribd company logo
9
Most read
10
Most read
12
Most read
August 31
BULGARIA AZURE BOOTCAMP IS POWERED BY:
Cloud Architecture Design Patterns
Proven Solutions to Common Challenges
Thanks to our Sponsors:
General Sponsors:
Technology Partner:
• Software Architect @
o 18+ years professional experience
• Microsoft Azure MVP
• External Expert Horizon 2020, Eurostars-Eureka
• External Expert InnoFund Denmark, RIF Cyprus
• Business Interests
o Web Development, SOA, Integration
o IoT, Machine Learning, Computer Intelligence
o Security & Performance Optimization
• Contact
ivelin.andreev@icb.bg
www.linkedin.com/in/ivelin
www.slideshare.net/ivoandreev
Speaker Bio
Takeaways
Azure Application Architecture Guide
• https://docs.microsoft.com/en-us/azure/architecture/guide/
Cloud Design Patterns for Azure (Series)
• Design and Implementation
• Availability and Resilience
• Data Management and Performance
Architecture be like
“bird’s eye view”
Implementation be like
“close-up”
Shortly after build completion
“the results”
Cloud Architecture Design Challenges
Availability
Data Management
Consistency
Messaging
Management & Monitoring
Performance & Scalability
Recover from Failures
Security
The time a system is functional and working (SLA Uptime %)
Data on multiple locations, performance and consistency
Predictable behaviour, reusable decisions, maintainability
Required by the distributed loosely coupled nature of the cloud
Expose runtime and debug information
Responsiveness within time unit, handle load w/o impact
Detecting failures, and recovering quickly and efficiently
Prevent malicious or accidental issues outside the designed usage
Management & Monitoring Patterns
Anti-corruption Layer
• Adapter layer between 2 subsystems to
isolate and translate semantics
• Consider
o Data consistency
o Extra maintenance point
o Permanent vs retiring layers
o Possible overhead and scalability challenges
o Interoperation with legacy system requires shared semantics
• Not Suitable
o No significant semantic differences between systems
Gateway Offloading Pattern
• Offload shared or specialized service
functionality to an API gateway / proxy
• Consider
o Central handling of shared features
o Maintain shared features in multiple places
o Delegate certain responsibilities to specialized team (i.e. security)
o Secure appropriate scaling, avoid bottlenecks
• Not Suitable
o When introducing coupling between services
o No business logic shall be offloaded (keep reusable)
When to use Messaging Services in Azure?
Event Grid
• Event-driven reactive
programming
Key Points
• Cheap (€0.5 per 1M)
• At least once delivery
• Does not deliver data
• Order delivery not possible
• Push-based delivery
Reason to Use
• React on event
Event Hub
• Big data and telemetry
pipeline
Key Points
• Semi-cheap (€9.2/month)
• At least once delivery
• Low latency, millions of
events per sec.
Reason to Use
• Telemetry streaming
Service Bus
• High value secure
messaging and control
Key Points
• 13M free, €0.0114 unit/h
• Batches, filters, duplicate
detection, transactions
• Pull-based delivery
• Order delivery
Reason to Use
• X-system transactions
https://docs.microsoft.com/en-us/azure/event-grid/compare-messaging-services
Claim-Check Pattern
• Split large messages into claim-payload to
protect message bus from overwhelming
• Consider
o Custom logic to apply pattern for large messages only
o Delete the message data after consuming
• Not Suitable
o Overhead for small messages
Messaging Patterns
Asynch Request-Reply
• Decouple backend processing from a frontend host
• Consider
o Validate request prior to starting a long running task
o API endpoint shall return:
• Location – a place where to poll, includes CorrelationID
• Retry Interval – when to retry for new status to reduce unnecessary load
o Callback endpoint could be used instead
• Not Suitable
o When response latency is important
o When callback, WebSockets or SignalR are possiblehttps://github.com/SeanFeldman/ServiceBus.AttachmentPlugin
Availability Patterns
Throttling
• Control resource consumption to allow
system functioning under extreme load
• Consider
o Reject requests from some users (service time or last)
o Degrade Quality of Service (bandwidth, compression, time)
o Delay operation (i.e. queue processing time)
o Provide specific Throttling error code to denied user
o Quickly detect high demand and apply throttling
Health Endpoint Monitoring
• Functional check of an application using
external endpoint on given interval
• Consider
o Tools (App Insights Web Tests, System Center Ops Manager)
o Get response time to a health verification endpoint
o Analyse results (Alive != Working, response body)
o Consider action in case of failure (i.e. restart)
o Secure the endpoint – authentication, IP filter
Two Types of Azure Queue Services?
Storage Queue
• Part of Azure storage infrastructure
• Simple Get/Put/Peek interface
Key Points
• No message ordering guarantee
• At least once delivery
• Intended for decoupling for scalability scenarios
• Scheduled delivery and poison message support
• No duplicate detection
• No session support
• Max message size 64KB
Service Bus Queue
• Part of Azure Messaging infrastructure
• Publish–subscribe model
Key Points
• Message ordering guarantee
• At least once / At most once delivery
• Transactions within a queue
• Scheduled delivery and poison message support
• Duplicate detection based on MessageId
• Session support for message processing affinity
• Max message size 1MB
https://docs.microsoft.com/en-us/azure/event-grid/compare-messaging-services
Pipes and Filters Integration
• Decompose a complex task in separate
individually scalable elements
• Suitable – reusable pipeline filters; avoid
bottleneck filters; breakable processing;
flexibility to reorder steps; context sharing
Consistent Design Patterns
• Sample Implementation
o Message Queue (i.e. AZ Service Bus) receives raw message
o Filter task (i.e. AZ Function App) listens and transforms message
o Message enqueued on next queue
o Until final message is built
• Not suitable – processing steps are not
independent (i.e. bad design) or transactional;
huge context may make the process
inefficient; not sufficient scalability of
underlying resources (i.e. DB)
https://github.com/mspnp/cloud-design-patterns/tree/master/pipes-and-filters
Gateway Aggregation
• Aggregate individual requests to one.
Improve performance on high-latency
network
• Suitable
o CorrelationID identification of original calls
o Partial response on service failure
o Caching
o No service coupling for backend services
o Near to backend to reduce latency
• Not Suitable
o Need to reduce calls to backend (i.e. with batch handling)
o Application is near to backend and latency is practically zero
Consistent Design Patterns
Command and Query Request Segregation
• Separate Read and Create operations to a datastore
for performance, scalability and security.
• Suitable
o Enqueue async commands
o Separate R/W databases, individual scaling R/W endpoints
• Not suitable
o Simple domain and business rules;
o When CRUD interface implementation is sufficient
Ambassador Proxy
• External process sends requests on behalf
of a consumer service or application
• Suitable
o Offload common topics on same host as a sidecar;
o Extend legacy or not modifiable apps
• Not suitable
o Latency overhead unacceptable
o Context sharing required
o Reusability cannot be achieved
Consistent Design Patterns
Strangler Façade
• Incrementally migrate a legacy system,
gradually replacing pieces of functionality
• Suitable
o Avoid bottleneck façade;
o Assure common resources are accessible
• Not suitable
o Cannot intercept backend calls;
o No complex wholesale replacement
Sidecar Pattern
• Deploy components in a separate process to
provide isolation and encapsulation
• i.e. Infrastructure Sidecar - monitors main app
• Consider
o Suitable interprocess communication (reliability, performance)
o Service or daemon instead of sidecar
• Suitable
o Heterogeneous languages
o Different teams or entity owns a component
o Independent update of components shall be enabled
• Not Suitable
o Performance of communication is critical
o Small solutions where the design benefit is not worth
o Individual scaling requirements may require a service
Consistent Design Patterns
Circuit Breaker Pattern
• Prevent application from repeatedly trying
to execute remote service, likely to fail.
• Suitable – temporary errors due to
timeout, network issues, high resource
utilization
o Closed – request routed to endpoint (Threshold)
o Open – request fails immediately (Timer)
o Half-open - limited number of requests are monitored to decide
on Open/Closed
• Challenges
o Resource differentiation and resource abstraction
o Manual override to open state
o Enqueue failed requests for reprocessing
• Not Suitable - local/in-memory resources
Resiliency Patterns
Resiliency Patterns
Compensating Transaction Pattern
• Undo the work from an eventually
consistent transaction from series of steps.
• Challenges
o Simple replace of previous state is rarely possible
o Record information on each step on how steps can be undone.
o Undo might not be doable in exactly the reverse order
o Consider retry logic to try avoiding compensating transactions
o Restore first the more sensitive to changes entities
o Compensating transaction shall be idempotent (repeatable)
• Suitable
o Avoid distributed transactions with eventual consistency
o Undo failed steps by performing the reverse action
• Not Suitable
o Try to avoid the complications if possible
Valet Key Pattern
• Token for restricted access to resource to offload
workload from the main application
• Consider
o Manage key validation, use short key expiration
o Key only for the required operation
o Audit all operations; deliver the key securely
o Provide the client with a key or token that the data store can validate.
• Not Suitable
o When action is required before sending to datastore.
o Limit user behavior – i.e. subscribe to events of resource to validate
Gatekeeper Pattern
• Limit attack surface by using dedicated
instance to sanitize and validate requests
• Challenges
o The backend host shall not expose unprotected endpoints
o May introduce single point of failure or performance hit
o Shall not perform actions other than sanitization
• Suitable
o Services with high degree of sensitive data
o Centralize validation
Security Patterns
Resiliency Patterns
Queue-Based Load Leveling
• Use a buffer queue between a task and a
service to smooth demand peaks.
• Suitable
o Maximize availability when overloading is expected
o Maximize scalability as Tasks and Services grow independently
o Reasonable cost – services scale on load, rather than max load
• Challenges
o Communication is one-way. When response is needed, use Async
request-reply with correlation ID (i.e. sequence Nr)
o Control the rate of consuming messages to avoid overload of
underlying resources (i.e. scaling consumers and DB contention)
• Not Suitable
o When minimal latency is critical
Performance and Scalability Patterns
Materialized View Pattern
• Prepopulated view in the necessary format
to support efficient querying
• Suitable
o Performance improvement; Limited data access
o Query simplification – ignore data complexity RDBMS + NOSQL
• Challenges
o Reusability – likely to have multiple hits
o Disposability – can be regenerated at any time
o Variability – can vary on user or query parameters
o Consistency – data may become outdated
o Regeneration – update on new data, manual trigger
• Not Suitable
o Easy to read source data
o Data changes very quickly and requires lots of regenerations
o Consistency is a priority
o Domain Driven Design – behaviour w/o data (as in microservices)

More Related Content

PPTX
Azure fundamentals
PPTX
Introduction to cloud computing
PPTX
Intro to Azure Service Bus
PPTX
Azure devops
PPTX
AWS vs Azure - Cloud Services Comparison
PPTX
Integration with Microsoft Azure using Mule ESB
PPTX
Introduction to Microsoft Azure
PPTX
Azure governance
Azure fundamentals
Introduction to cloud computing
Intro to Azure Service Bus
Azure devops
AWS vs Azure - Cloud Services Comparison
Integration with Microsoft Azure using Mule ESB
Introduction to Microsoft Azure
Azure governance

What's hot (20)

PPTX
Azure Service Bus
PDF
PDF
The Layman's Guide to Microsoft Azure
PPTX
Introduction of Windows azure and overview
PPTX
Part 01: Azure Virtual Networks – An Overview
PPTX
Cloud Computing
PPTX
cloud computing
PPTX
Introduction to Microservices
PDF
Amazon OpenSearch - Use Cases, Security/Observability, Serverless and Enhance...
PPTX
Microsoft Cloud Adoption Framework for Azure: Governance Conversation
PPTX
Azure Security Fundamentals
PPTX
Microsoft Azure Networking Basics
PPTX
Azure Governance
PPTX
Azure Migration .pptx
PPTX
Google Cloud Platform
PPTX
Elastic Compute Cloud (EC2) on AWS Presentation
PPTX
Stephane Lapointe: Governance in Azure, keep control of your environments
PPTX
Cloud computing
PDF
Continuous Delivery to Kubernetes with Jenkins and Helm
Azure Service Bus
The Layman's Guide to Microsoft Azure
Introduction of Windows azure and overview
Part 01: Azure Virtual Networks – An Overview
Cloud Computing
cloud computing
Introduction to Microservices
Amazon OpenSearch - Use Cases, Security/Observability, Serverless and Enhance...
Microsoft Cloud Adoption Framework for Azure: Governance Conversation
Azure Security Fundamentals
Microsoft Azure Networking Basics
Azure Governance
Azure Migration .pptx
Google Cloud Platform
Elastic Compute Cloud (EC2) on AWS Presentation
Stephane Lapointe: Governance in Azure, keep control of your environments
Cloud computing
Continuous Delivery to Kubernetes with Jenkins and Helm
Ad

Similar to Azure architecture design patterns - proven solutions to common challenges (20)

PPTX
Applicare patterns di sviluppo con Azure
PDF
Cloud Design Patterns
PDF
Cloud application architecture with Microsoft Azure
PDF
Patterns of Distributed Application Design
PPTX
Designing microservices part2
PPTX
Cloud design principles
PPTX
Serhiy Kalinets "Embracing architectural challenges in the modern .NET world"
PPTX
Patterns of Distributed Application Design
PPTX
Cloud computing
PPTX
Cloud Computing - Geektalk
DOCX
Microservices with asp dot net core, a next gen technology
PDF
Azure Application Architecture Guide ~Design principles for Azure application...
PPTX
Architecting Microservices in .Net
PDF
MS Cloud Design Patterns Infographic 2015
PDF
Ms cloud design patterns infographic 2015
PPTX
Microservices with .Net - NDC Sydney, 2016
PPTX
Azure Application Architecture Guide
PPTX
8 cloud design patterns you ought to know - Update Conference 2018
PPTX
Cloud Design Patterns
PPTX
Introduction to Microservices Patterns
Applicare patterns di sviluppo con Azure
Cloud Design Patterns
Cloud application architecture with Microsoft Azure
Patterns of Distributed Application Design
Designing microservices part2
Cloud design principles
Serhiy Kalinets "Embracing architectural challenges in the modern .NET world"
Patterns of Distributed Application Design
Cloud computing
Cloud Computing - Geektalk
Microservices with asp dot net core, a next gen technology
Azure Application Architecture Guide ~Design principles for Azure application...
Architecting Microservices in .Net
MS Cloud Design Patterns Infographic 2015
Ms cloud design patterns infographic 2015
Microservices with .Net - NDC Sydney, 2016
Azure Application Architecture Guide
8 cloud design patterns you ought to know - Update Conference 2018
Cloud Design Patterns
Introduction to Microservices Patterns
Ad

More from Ivo Andreev (20)

PDF
Multi-Agent Era will Define the Future of Software
PDF
LLM-based Multi-Agent Systems to Replace Traditional Software
PDF
LLM Security - Smart to protect, but too smart to be protected
PDF
What are Phi Small Language Models Capable of
PDF
Autonomous Control AI Training from Data
PDF
Autonomous Systems for Optimization and Control
PDF
Cybersecurity and Generative AI - for Good and Bad vol.2
PDF
Architecting AI Solutions in Azure for Business
PDF
Cybersecurity Challenges with Generative AI - for Good and Bad
PDF
JS-Experts - Cybersecurity for Generative AI
PDF
How do OpenAI GPT Models Work - Misconceptions and Tips for Developers
PDF
OpenAI GPT in Depth - Questions and Misconceptions
PDF
Cutting Edge Computer Vision for Everyone
PDF
Collecting and Analysing Spaceborn Data
PDF
Collecting and Analysing Satellite Data with Azure Orbital
PDF
Language Studio and Custom Models
PDF
CosmosDB for IoT Scenarios
PDF
Forecasting time series powerful and simple
PDF
Constrained Optimization with Genetic Algorithms and Project Bonsai
PDF
Azure security guidelines for developers
Multi-Agent Era will Define the Future of Software
LLM-based Multi-Agent Systems to Replace Traditional Software
LLM Security - Smart to protect, but too smart to be protected
What are Phi Small Language Models Capable of
Autonomous Control AI Training from Data
Autonomous Systems for Optimization and Control
Cybersecurity and Generative AI - for Good and Bad vol.2
Architecting AI Solutions in Azure for Business
Cybersecurity Challenges with Generative AI - for Good and Bad
JS-Experts - Cybersecurity for Generative AI
How do OpenAI GPT Models Work - Misconceptions and Tips for Developers
OpenAI GPT in Depth - Questions and Misconceptions
Cutting Edge Computer Vision for Everyone
Collecting and Analysing Spaceborn Data
Collecting and Analysing Satellite Data with Azure Orbital
Language Studio and Custom Models
CosmosDB for IoT Scenarios
Forecasting time series powerful and simple
Constrained Optimization with Genetic Algorithms and Project Bonsai
Azure security guidelines for developers

Recently uploaded (20)

PPTX
VVF-Customer-Presentation2025-Ver1.9.pptx
PDF
Which alternative to Crystal Reports is best for small or large businesses.pdf
PDF
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
PPTX
Operating system designcfffgfgggggggvggggggggg
PDF
top salesforce developer skills in 2025.pdf
PDF
2025 Textile ERP Trends: SAP, Odoo & Oracle
PDF
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
PDF
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
PPTX
CHAPTER 12 - CYBER SECURITY AND FUTURE SKILLS (1) (1).pptx
PPTX
Transform Your Business with a Software ERP System
PDF
medical staffing services at VALiNTRY
PDF
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
PDF
Understanding Forklifts - TECH EHS Solution
PDF
How to Migrate SBCGlobal Email to Yahoo Easily
PPTX
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
PDF
PTS Company Brochure 2025 (1).pdf.......
PPTX
history of c programming in notes for students .pptx
PPTX
Introduction to Artificial Intelligence
PDF
System and Network Administraation Chapter 3
PPTX
Online Work Permit System for Fast Permit Processing
VVF-Customer-Presentation2025-Ver1.9.pptx
Which alternative to Crystal Reports is best for small or large businesses.pdf
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
Operating system designcfffgfgggggggvggggggggg
top salesforce developer skills in 2025.pdf
2025 Textile ERP Trends: SAP, Odoo & Oracle
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
CHAPTER 12 - CYBER SECURITY AND FUTURE SKILLS (1) (1).pptx
Transform Your Business with a Software ERP System
medical staffing services at VALiNTRY
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
Understanding Forklifts - TECH EHS Solution
How to Migrate SBCGlobal Email to Yahoo Easily
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
PTS Company Brochure 2025 (1).pdf.......
history of c programming in notes for students .pptx
Introduction to Artificial Intelligence
System and Network Administraation Chapter 3
Online Work Permit System for Fast Permit Processing

Azure architecture design patterns - proven solutions to common challenges

  • 1. August 31 BULGARIA AZURE BOOTCAMP IS POWERED BY: Cloud Architecture Design Patterns Proven Solutions to Common Challenges
  • 2. Thanks to our Sponsors: General Sponsors: Technology Partner:
  • 3. • Software Architect @ o 18+ years professional experience • Microsoft Azure MVP • External Expert Horizon 2020, Eurostars-Eureka • External Expert InnoFund Denmark, RIF Cyprus • Business Interests o Web Development, SOA, Integration o IoT, Machine Learning, Computer Intelligence o Security & Performance Optimization • Contact ivelin.andreev@icb.bg www.linkedin.com/in/ivelin www.slideshare.net/ivoandreev Speaker Bio
  • 4. Takeaways Azure Application Architecture Guide • https://docs.microsoft.com/en-us/azure/architecture/guide/ Cloud Design Patterns for Azure (Series) • Design and Implementation • Availability and Resilience • Data Management and Performance
  • 5. Architecture be like “bird’s eye view” Implementation be like “close-up”
  • 6. Shortly after build completion “the results”
  • 7. Cloud Architecture Design Challenges Availability Data Management Consistency Messaging Management & Monitoring Performance & Scalability Recover from Failures Security The time a system is functional and working (SLA Uptime %) Data on multiple locations, performance and consistency Predictable behaviour, reusable decisions, maintainability Required by the distributed loosely coupled nature of the cloud Expose runtime and debug information Responsiveness within time unit, handle load w/o impact Detecting failures, and recovering quickly and efficiently Prevent malicious or accidental issues outside the designed usage
  • 8. Management & Monitoring Patterns Anti-corruption Layer • Adapter layer between 2 subsystems to isolate and translate semantics • Consider o Data consistency o Extra maintenance point o Permanent vs retiring layers o Possible overhead and scalability challenges o Interoperation with legacy system requires shared semantics • Not Suitable o No significant semantic differences between systems Gateway Offloading Pattern • Offload shared or specialized service functionality to an API gateway / proxy • Consider o Central handling of shared features o Maintain shared features in multiple places o Delegate certain responsibilities to specialized team (i.e. security) o Secure appropriate scaling, avoid bottlenecks • Not Suitable o When introducing coupling between services o No business logic shall be offloaded (keep reusable)
  • 9. When to use Messaging Services in Azure? Event Grid • Event-driven reactive programming Key Points • Cheap (€0.5 per 1M) • At least once delivery • Does not deliver data • Order delivery not possible • Push-based delivery Reason to Use • React on event Event Hub • Big data and telemetry pipeline Key Points • Semi-cheap (€9.2/month) • At least once delivery • Low latency, millions of events per sec. Reason to Use • Telemetry streaming Service Bus • High value secure messaging and control Key Points • 13M free, €0.0114 unit/h • Batches, filters, duplicate detection, transactions • Pull-based delivery • Order delivery Reason to Use • X-system transactions https://docs.microsoft.com/en-us/azure/event-grid/compare-messaging-services
  • 10. Claim-Check Pattern • Split large messages into claim-payload to protect message bus from overwhelming • Consider o Custom logic to apply pattern for large messages only o Delete the message data after consuming • Not Suitable o Overhead for small messages Messaging Patterns Asynch Request-Reply • Decouple backend processing from a frontend host • Consider o Validate request prior to starting a long running task o API endpoint shall return: • Location – a place where to poll, includes CorrelationID • Retry Interval – when to retry for new status to reduce unnecessary load o Callback endpoint could be used instead • Not Suitable o When response latency is important o When callback, WebSockets or SignalR are possiblehttps://github.com/SeanFeldman/ServiceBus.AttachmentPlugin
  • 11. Availability Patterns Throttling • Control resource consumption to allow system functioning under extreme load • Consider o Reject requests from some users (service time or last) o Degrade Quality of Service (bandwidth, compression, time) o Delay operation (i.e. queue processing time) o Provide specific Throttling error code to denied user o Quickly detect high demand and apply throttling Health Endpoint Monitoring • Functional check of an application using external endpoint on given interval • Consider o Tools (App Insights Web Tests, System Center Ops Manager) o Get response time to a health verification endpoint o Analyse results (Alive != Working, response body) o Consider action in case of failure (i.e. restart) o Secure the endpoint – authentication, IP filter
  • 12. Two Types of Azure Queue Services? Storage Queue • Part of Azure storage infrastructure • Simple Get/Put/Peek interface Key Points • No message ordering guarantee • At least once delivery • Intended for decoupling for scalability scenarios • Scheduled delivery and poison message support • No duplicate detection • No session support • Max message size 64KB Service Bus Queue • Part of Azure Messaging infrastructure • Publish–subscribe model Key Points • Message ordering guarantee • At least once / At most once delivery • Transactions within a queue • Scheduled delivery and poison message support • Duplicate detection based on MessageId • Session support for message processing affinity • Max message size 1MB https://docs.microsoft.com/en-us/azure/event-grid/compare-messaging-services
  • 13. Pipes and Filters Integration • Decompose a complex task in separate individually scalable elements • Suitable – reusable pipeline filters; avoid bottleneck filters; breakable processing; flexibility to reorder steps; context sharing Consistent Design Patterns • Sample Implementation o Message Queue (i.e. AZ Service Bus) receives raw message o Filter task (i.e. AZ Function App) listens and transforms message o Message enqueued on next queue o Until final message is built • Not suitable – processing steps are not independent (i.e. bad design) or transactional; huge context may make the process inefficient; not sufficient scalability of underlying resources (i.e. DB) https://github.com/mspnp/cloud-design-patterns/tree/master/pipes-and-filters
  • 14. Gateway Aggregation • Aggregate individual requests to one. Improve performance on high-latency network • Suitable o CorrelationID identification of original calls o Partial response on service failure o Caching o No service coupling for backend services o Near to backend to reduce latency • Not Suitable o Need to reduce calls to backend (i.e. with batch handling) o Application is near to backend and latency is practically zero Consistent Design Patterns Command and Query Request Segregation • Separate Read and Create operations to a datastore for performance, scalability and security. • Suitable o Enqueue async commands o Separate R/W databases, individual scaling R/W endpoints • Not suitable o Simple domain and business rules; o When CRUD interface implementation is sufficient
  • 15. Ambassador Proxy • External process sends requests on behalf of a consumer service or application • Suitable o Offload common topics on same host as a sidecar; o Extend legacy or not modifiable apps • Not suitable o Latency overhead unacceptable o Context sharing required o Reusability cannot be achieved Consistent Design Patterns Strangler Façade • Incrementally migrate a legacy system, gradually replacing pieces of functionality • Suitable o Avoid bottleneck façade; o Assure common resources are accessible • Not suitable o Cannot intercept backend calls; o No complex wholesale replacement
  • 16. Sidecar Pattern • Deploy components in a separate process to provide isolation and encapsulation • i.e. Infrastructure Sidecar - monitors main app • Consider o Suitable interprocess communication (reliability, performance) o Service or daemon instead of sidecar • Suitable o Heterogeneous languages o Different teams or entity owns a component o Independent update of components shall be enabled • Not Suitable o Performance of communication is critical o Small solutions where the design benefit is not worth o Individual scaling requirements may require a service Consistent Design Patterns
  • 17. Circuit Breaker Pattern • Prevent application from repeatedly trying to execute remote service, likely to fail. • Suitable – temporary errors due to timeout, network issues, high resource utilization o Closed – request routed to endpoint (Threshold) o Open – request fails immediately (Timer) o Half-open - limited number of requests are monitored to decide on Open/Closed • Challenges o Resource differentiation and resource abstraction o Manual override to open state o Enqueue failed requests for reprocessing • Not Suitable - local/in-memory resources Resiliency Patterns
  • 18. Resiliency Patterns Compensating Transaction Pattern • Undo the work from an eventually consistent transaction from series of steps. • Challenges o Simple replace of previous state is rarely possible o Record information on each step on how steps can be undone. o Undo might not be doable in exactly the reverse order o Consider retry logic to try avoiding compensating transactions o Restore first the more sensitive to changes entities o Compensating transaction shall be idempotent (repeatable) • Suitable o Avoid distributed transactions with eventual consistency o Undo failed steps by performing the reverse action • Not Suitable o Try to avoid the complications if possible
  • 19. Valet Key Pattern • Token for restricted access to resource to offload workload from the main application • Consider o Manage key validation, use short key expiration o Key only for the required operation o Audit all operations; deliver the key securely o Provide the client with a key or token that the data store can validate. • Not Suitable o When action is required before sending to datastore. o Limit user behavior – i.e. subscribe to events of resource to validate Gatekeeper Pattern • Limit attack surface by using dedicated instance to sanitize and validate requests • Challenges o The backend host shall not expose unprotected endpoints o May introduce single point of failure or performance hit o Shall not perform actions other than sanitization • Suitable o Services with high degree of sensitive data o Centralize validation Security Patterns
  • 20. Resiliency Patterns Queue-Based Load Leveling • Use a buffer queue between a task and a service to smooth demand peaks. • Suitable o Maximize availability when overloading is expected o Maximize scalability as Tasks and Services grow independently o Reasonable cost – services scale on load, rather than max load • Challenges o Communication is one-way. When response is needed, use Async request-reply with correlation ID (i.e. sequence Nr) o Control the rate of consuming messages to avoid overload of underlying resources (i.e. scaling consumers and DB contention) • Not Suitable o When minimal latency is critical
  • 21. Performance and Scalability Patterns Materialized View Pattern • Prepopulated view in the necessary format to support efficient querying • Suitable o Performance improvement; Limited data access o Query simplification – ignore data complexity RDBMS + NOSQL • Challenges o Reusability – likely to have multiple hits o Disposability – can be regenerated at any time o Variability – can vary on user or query parameters o Consistency – data may become outdated o Regeneration – update on new data, manual trigger • Not Suitable o Easy to read source data o Data changes very quickly and requires lots of regenerations o Consistency is a priority o Domain Driven Design – behaviour w/o data (as in microservices)