Skip to main content

Welcome to a Grasp lesson

Create a free account to keep studying and create your own study path.

Lesson 66

Assessing and Improving Architecture with the Well-Architected Framework

Recommended resources

Welcome to the penultimate lesson in our capstone module. We've journeyed from the foundational concepts of Azure governance to the intricacies of specific services. In our last session, we examined the shared responsibility model, a critical component of the Security pillar within the Azure Well-Architected Framework. You learned how responsibility shifts across IaaS, PaaS, and SaaS, and why understanding this division is fundamental to designing secure systems.

Today, we'll broaden our scope from a single concept within one pillar to applying the entire framework holistically. This lesson is designed to equip you with a systematic method for architectural evaluation, a core competency for a Principal Engineer. Our goal is to evaluate a sample architecture against the Well-Architected Framework pillars and propose concrete improvements. We will move from the theoretical principles we've discussed to the practical art and science of architectural review, focusing on identifying strengths, weaknesses, and the inevitable trade-offs.

The Architect's Compass: Using the Well-Architected Framework

Before we can evaluate an architecture, we need a robust methodology. The Well-Architected Framework (WAF) provides just that. It's not merely a checklist but a thinking tool to guide design decisions and facilitate conversations about trade-offs.

John Savill offers an excellent overview of how to approach and use the framework effectively. As you watch, pay close attention to his distinction between "well-architected" and "well-implemented," and his emphasis on the trade-offs between pillars. This is where high-level architectural strategy comes into play.

Using the Well-Architected Framework

This video provides a practical guide to the structure and application of the Well-Architected Framework, including the crucial concepts of trade-offs and the assessment tools.

Please watch the following segments: What is WAF? This section distinguishes the framework from the Cloud Adoption Framework (CAF) and defines a "workload," setting the stage for our analysis. The Five Pillars. Here, John introduces the five pillars and the design principles that underpin each one. Tradeoffs. This is perhaps the most critical section for an architect. It explores the inherent conflicts between pillars, such as Cost Optimization vs. Reliability, which you will constantly navigate. How to use WAF and Assessments. This part introduces the practical application, including the valuable Well-Architected Framework assessment tool in the Azure portal.

The key insight from the video is that the WAF is a continuous process, not a one-time review. It provides a structured way to reason about your design choices and, crucially, to understand their second-order effects on other aspects of the system. The tension between reliability and cost is a classic example that you will encounter in virtually every project.


Case Study: Microservices on Azure Kubernetes Service (AKS)

Now, let's apply this framework to a real-world scenario. We'll analyze a common and sophisticated pattern: a microservices application running on Azure Kubernetes Service (AKS). The document below from Microsoft's Azure Architecture Center describes a reference architecture for a drone delivery application. It's conveniently structured around the WAF pillars, making it an excellent learning tool.

Microservices Architecture on Azure Kubernetes Service

This document details a reference architecture for a microservices application on AKS, explaining the components, data flow, and design considerations aligned with the Well-Architected Framework.

First, familiarize yourself with the proposed design. Read the introductory section and study the Architecture diagram and Data flow description. You can find these from the start of the document down to the end of the components list. Your goal is to understand what the system does and which Azure services are involved.

This architecture uses a collection of services we've discussed throughout this course, including AKS, Service Bus, Cosmos DB, and Microsoft Entra ID, orchestrated within a CI/CD pipeline. It represents a modern, cloud-native approach to application design.


Evaluating the Architecture Pillar by Pillar

Our task is to critically evaluate this design. For each pillar, we will review the choices made by the architects and consider their implications.

1. Reliability

Reliability ensures your application can meet its commitments to users. This involves resilience (handling failures) and recoverability (recovering from them).

Microservices Architecture on Azure Kubernetes Service

The document provides specific guidance on designing for reliability in an AKS environment.

Read the section on Reliability considerations, focusing on the use of namespaces, health probes, and dependent service checks. Also, read the initial part of the Design section that covers data storage.

Analysis:

  • Decoupling and Failure Isolation: The architecture uses asynchronous communication via Azure Service Bus (Publisher-Subscriber and Competing Consumers patterns). This is a strong reliability choice. If the Workflow microservice is down, the Ingestion service can still accept requests and queue them, preventing immediate failure from the client's perspective.
  • State Management: The document correctly advises against storing persistent data in local cluster storage and recommends external services like Cosmos DB. This decouples the service's state from the compute instance, allowing pods to be terminated and replaced without data loss—a fundamental principle for reliable, scalable systems.
  • Health Probes: The use of readiness, liveness, and startup probes is critical for reliability in Kubernetes. They allow AKS to correctly manage pod lifecycles, routing traffic only to healthy instances and restarting failed ones. The warning about cascading failures from readiness probes checking external dependencies is a sign of mature architectural thinking.

Proposed Improvement/Question for Thought: The architecture shows a single Service Bus queue. While Service Bus is a highly reliable service, what would be the impact of a regional Service Bus outage? For a mission-critical system, you might propose a cross-region disaster recovery strategy, perhaps using geo-disaster recovery features of Service Bus Premium or a more complex pattern involving replicating messages to a secondary region.

2. Security

Security is about providing confidentiality, integrity, and availability. We touched on this in the last lesson with the shared responsibility model. Here, we see it applied.

Microservices Architecture on Azure Kubernetes Service

This section details the security measures implemented in the reference architecture.

Please read the entire Security section. Pay attention to how identity, network traffic, and secrets are managed.

Analysis:

  • Identity Management: The architecture uses Microsoft Entra Workload ID. This is a best practice, superseding older methods. It allows pods to have their own identity and securely access other Azure resources (like Key Vault or databases) without storing secrets like connection strings in application configuration. This directly addresses the principle of least privilege.
  • Network Security: The recommendation to use Azure CNI powered by Cilium and enforce deny-all network policies by default embodies a Zero Trust mindset. It forces developers to be explicit about which microservices can communicate, drastically reducing the attack surface.
  • Secrets Management: The architecture correctly centralizes secret management in Azure Key Vault and uses the CSI driver to mount secrets as volumes in pods. This prevents secrets from being exposed in code or environment variables.

Proposed Improvement/Question for Thought: The document mentions using Microsoft Defender for Containers. While listed, it's worth emphasizing its importance. An improvement would be to make its integration a mandatory part of the operational checklist, providing runtime threat detection for nodes and containers, which is a layer of security beyond the static configuration.

3. Cost Optimization

Cost Optimization is about reducing unnecessary expenses and improving operational efficiencies while still meeting business requirements.

Microservices Architecture on Azure Kubernetes Service

This section outlines strategies for managing the costs associated with an AKS-based solution.

Read the Cost Optimization section. Note the suggestions for both the AKS cluster and the supporting services.

Analysis:

  • Scaling: The architecture proposes using the Horizontal Pod Autoscaler (HPA) to scale microservices and the Cluster Autoscaler (CA) to scale nodes. This is the fundamental mechanism for matching capacity to demand, which is the primary driver of cost efficiency in the cloud.
  • Leveraging Different VM Types: The recommendation to use spot node pools for non-critical workloads is a powerful cost-saving technique. For example, batch processing or development workloads within the cluster could run on spot instances at a significant discount, while user-facing services run on standard VMs.

Proposed Improvement/Question for Thought: The reference architecture uses several distinct data stores (Cosmos DB, Redis, MongoDB mentioned in the diagram description). While this "polyglot persistence" approach can be technically optimal for each service, it can increase cost and operational complexity. An improvement could be to evaluate if some of these could be consolidated. For example, could Azure Cache for Redis handle some of the state currently in another database, or could a single Cosmos DB instance using different containers serve multiple microservices? This is a classic trade-off between performance/fit and cost/simplicity.

4. Operational Excellence

Operational Excellence covers the processes that deploy an application and keep it running in production, including automation, deployment strategies, and monitoring.

Microservices Architecture on Azure Kubernetes Service

These sections cover the DevOps and observability aspects of the architecture.

Read the Deployment (CI/CD) section and the short Operational Excellence section.

Analysis:

  • Automation: The architecture is built on a foundation of CI/CD with Azure Pipelines and Infrastructure as Code (Bicep). This is non-negotiable for operational excellence. It ensures repeatable, reliable deployments and reduces manual error.
  • Observability: The integration of Azure Monitor and Application Insights is crucial. In a microservices environment, being able to perform distributed tracing (seeing a request flow through multiple services) is essential for debugging and performance tuning. The "application map" feature is a powerful visualization tool for this.

5. Performance Efficiency

Performance Efficiency is the ability of your workload to scale and meet the demands placed on it in an efficient manner.

Architecture Best Practices for Azure App Service (Web Apps)

While this document focuses on App Service, its discussion on performance anti-patterns and tradeoffs is universally applicable and provides a valuable parallel to the AKS architecture.

To broaden our perspective, let's look at another document. Read the section on performance antipatterns and the section on tradeoffs.

Analysis (Applying concepts to the AKS architecture):

  • Avoiding Antipatterns: The AKS architecture avoids the "Busy Front-End" antipattern by offloading work to the Workflow microservice via a queue. It avoids the "No Caching" antipattern by explicitly including Azure Cache for Redis for the delivery service to quickly retrieve status.
  • Scaling and Performance: The use of AKS itself, designed for orchestrating containers at scale, is a primary choice for performance efficiency. The recommendation to use Azure CNI powered by Cilium highlights a focus on network performance, as its eBPF-based data plane can offer lower latency than traditional solutions.

The WAF Assessment and Proposing Improvements

Reading through a reference architecture is one thing; performing an assessment on your own workload is another. This is where the Well-Architected Review assessment tool in the Azure portal becomes invaluable. It guides you through a series of questions based on the WAF principles.

This is an example of the output from a Well-Architected Review. It provides a prioritized list of recommendations across different design areas, helping you focus your improvement efforts.

Imagine we ran this assessment on our drone delivery application. The tool might generate recommendations like:

  • (Reliability): "You have not configured geo-replication for your Azure Service Bus namespace. For mission-critical workloads, this creates a single point of failure at the regional level."
  • (Security): "Several workloads are running in privileged container mode. This violates the principle of least privilege and should be remediated."
  • (Cost Optimization): "Your cluster is running at 30% average CPU utilization over the last 30 days. Consider configuring more aggressive scale-in policies for your cluster autoscaler or using a spot node pool for eligible workloads."

As an architect, your role is to take this output, understand the business context (e.g., is this app truly mission-critical?), and translate these recommendations into an actionable roadmap for the engineering team, always balancing the trade-offs.


Conclusion

In this lesson, we transitioned from learning about the WAF pillars to actively using them as an evaluation tool. We dissected a sophisticated microservices architecture, analyzing its design choices through the lens of the five pillars.

Key Takeaways:

  • The Well-Architected Framework is a systematic guide for making and evaluating architectural decisions.
  • Evaluating an architecture requires looking at it holistically across all five pillars: Reliability, Security, Cost Optimization, Operational Excellence, and Performance Efficiency.
  • Architecture is a game of trade-offs. Improving reliability might increase cost; simplifying a design might reduce performance. A principal engineer's job is to find the right balance for the given business requirements.
  • The Azure Well-Architected Review tool can operationalize this process, providing a structured questionnaire and actionable recommendations to guide continuous improvement.

This exercise of evaluating a reference architecture is a direct preparation for our final lesson. There, we will analyze a broader set of Azure reference architectures for various common patterns, further honing your ability to recognize good design and apply these principles across different scenarios.