CloudVol. 7 · Part VII
0 / 0

Shelves / Cloud

CL·91

Well-Architected Thinking

The cross-cloud discipline for judging architectures: the six pillars (operational excellence, security, reliability, performance efficiency, cost optimisation, sustainability) with their design principles and concrete practices; disaster recovery strategies with RPO and RTO; FinOps and unit economics; carbon-aware design; how the AWS, Azure and Google frameworks compare; and running an architecture review that answers the six questions: how is it operated, secured, how does it fail, scale, what does it cost, and what is its performance envelope.

22 topics · ~18 min read · 30-question quiz
Updated Suggest a correction

Start here: reviewing an architecture with six questions

Six questions for every design

AWS, Azure and Google Cloud each publish an architecture framework, and they ask much the same questions. AWS's Well-Architected Framework has six pillars:

Pillar The question Typical evidence
Operational excellence Can we run, change and improve it safely? IaC, CI/CD, runbooks, observability, post-incident reviews
Security Is every identity, network path and piece of data protected? Least privilege, encryption, logging, detection, patching
Reliability Does it keep working through failures and recover when it doesn't? Multi-AZ, health checks, backups tested, SLOs, DR plan
Performance efficiency Does it use the right resources and keep fast as it grows? Load tests, right instance types, caching, scaling
Cost optimisation Does it deliver value at the lowest sensible cost? Tagging, rightsizing, commitments, lifecycle, budgets
Sustainability Does it minimise the energy and resources it needs? Utilisation, efficient instance types (Arm), data retention

A review is a structured conversation: for each pillar, ask the questions, collect evidence, record risks (high or medium) and agree improvements. Tools automate the parts that can be read from configuration.

An automated first pass

Running cdk-nag's AwsSolutionsChecks over chapter 90's 30-line CDK app:

Text
cdk-nag AwsSolutions: 42 rule checks, 15 non-compliant, 27 compliant
   AwsSolutions-CFR1 ×1  The CloudFront distribution may require Geo restrictions.
   AwsSolutions-CFR2 ×1  The CloudFront distribution may require integration with AWS WAF.
   AwsSolutions-CFR3 ×1  The CloudFront distribution does not have access logging enabled.
   AwsSolutions-CFR4 ×1  The CloudFront distribution allows for SSLv3 or TLSv1 for HTTPS viewer connections.
   AwsSolutions-EC23 ×1  The Security Group allows for 0.0.0.0/0 or ::/0 inbound access.
   AwsSolutions-ECS4 ×1  The ECS Cluster has CloudWatch Container Insights disabled.
   AwsSolutions-ELB2 ×1  The ELB does not have access logs enabled.
   AwsSolutions-RDS10 ×1  The RDS instance or Aurora DB cluster does not have deletion protection enabled.
   AwsSolutions-RDS11 ×1  The RDS instance or Aurora DB cluster uses the default endpoint port.
   AwsSolutions-RDS2 ×1  The RDS instance or Aurora DB cluster does not have storage encryption enabled.
   AwsSolutions-S1  ×1  The S3 Bucket has server access logs disabled.
   AwsSolutions-SMG4 ×1  The secret does not have automatic rotation scheduled.
   AwsSolutions-SQS4 ×2  The SQS queue does not require requests to use SSL.
   AwsSolutions-VPC7 ×1  The VPC does not have an associated Flow Log.

Not every finding is a problem to fix: a public load balancer should accept 0.0.0.0/0 on 443 (EC23), and changing the database port (RDS11) is security through obscurity. Each one gets a decision: fix it, or record a documented suppression with a reason, which is exactly what a review is for. The serious ones here are unencrypted database storage (RDS2), no deletion protection (RDS10), no audit trail of network traffic or requests (VPC7, ELB2, S1, CFR3), old TLS versions allowed at the CDN (CFR4), and an unrotated secret (SMG4).

Reliability needs numbers: SLOs and error budgets

"Highly available" isn't a requirement; "99.9% of requests succeed in under 300 ms, measured monthly" is. That service-level objective gives an error budget:

Text
SLO 99%    over 30 days: error budget 432.0 minutes, or 10,000 failed requests per million
SLO 99.9%  over 30 days: error budget  43.2 minutes, or  1,000 failed requests per million
SLO 99.95% over 30 days: error budget  21.6 minutes, or    500 failed requests per million
SLO 99.99% over 30 days: error budget   4.3 minutes, or    100 failed requests per million

The budget makes trade-offs explicit: while it lasts, ship features; when it's spent, spend effort on reliability. It also drives alerting: alert on how fast the budget is burning, not on every error (the lab computes burn rates).

How deep to go in Well-Architected thinking

Volume 17 defines six mastery levels. For this chapter they look like this; the chapter aims at L3 everywhere, and its lab at L4.

Level What you can do
L1 Name the pillars and their core questions
L2 Run automated checks and fix or suppress findings with reasons
L3 Explain each pillar's practices, trade-offs between pillars, SLOs and DR strategies
L4 Diagnose architectural risks from incidents, bills and reviews
L5 Lead architecture reviews and make defensible trade-offs for a system
L6 Run review programmes, guard rails and improvement tracking across an organisation

Six questions for every architecture

The roadmap reduces Well-Architected thinking to six questions to ask of every design, from a weekend project to a payments platform:

Question Pillar
How is it operated? Operational excellence
How is it secured? Security
How does it fail? Reliability
How does it scale? / What's the performance envelope? Performance efficiency
What does it cost? Cost optimisation
(and what is its environmental footprint?) Sustainability

The frameworks were formalised by the cloud providers: the AWS Well-Architected Framework (2015; six pillars since sustainability was added in 2021), the Azure Well-Architected Framework (five pillars: reliability, security, cost optimisation, operational excellence, performance efficiency; sustainability guidance separately), and the Google Cloud Well-Architected Framework (formerly the Architecture Framework; pillars plus cross-pillar perspectives such as AI/ML). They overlap heavily; the ideas apply to any infrastructure, cloud or not.

workload+ business requirements operational excellence security reliability sustainability cost optimisation performance efficiency reliability ↔ cost ops ↔ sustain.
The six pillars as a balanced set of concerns around a workload. Improving one pillar often costs another (more redundancy raises cost; stricter security can slow operations), so architecture is the art of explicit trade-offs informed by business requirements.

Operational excellence

How is it operated? The ability to run, observe and improve workloads, and to change them safely and often.

Design principles:

  • Perform operations as code: infrastructure, configuration, deployments, runbooks and policies in version control (Vol. 8). No snowflake servers or console-only changes.
  • Make frequent, small, reversible changes: CI/CD, progressive delivery, feature flags (Vol. 6 ch. 84).
  • Refine operations procedures frequently: game days, runbook reviews.
  • Anticipate failure: pre-mortems, chaos experiments (Vol. 5 ch. 78).
  • Learn from all operational events: blameless post-incident reviews with tracked actions.
  • Use managed services to shed undifferentiated heavy lifting.

Practices and questions:

Question Good answer looks like
How do we know it's healthy? SLOs on user-facing signals, dashboards, alerts on symptoms (not just causes), distributed tracing (Vol. 9)
How do we deploy? Automated pipeline, immutable artefacts, gradual rollout, automated rollback
How do we respond to incidents? On-call rotation, runbooks linked from alerts, incident roles, status communication
Who owns it? A named team with the authority and capacity to operate it ("you build it, you run it")
How do we change infrastructure? IaC with review, drift detection, policy checks

Security

How is it secured? Protecting data, systems and assets while enabling the business.

Design principles (AWS's phrasing; others are equivalent):

  • Implement a strong identity foundation: least privilege, central identity, no long-lived credentials (chapter 89).
  • Maintain traceability: log and audit every action (CloudTrail, Activity Log, Audit Logs) and monitor for anomalies.
  • Apply security at all layers: edge, network, compute, application, data (defence in depth).
  • Automate security best practices: guardrails as code (SCPs, Azure Policy, org policies), secure baselines, policy checks in CI.
  • Protect data in transit and at rest: TLS everywhere, KMS-backed encryption, classification.
  • Keep people away from data: automation and break-glass rather than routine human access to production data.
  • Prepare for security events: incident response plans, forensics-ready logging, practised runbooks.

Questions: Who can access production, and how is that reviewed? What's exposed to the internet, and why? Where's sensitive data, how is it encrypted, who can decrypt it? How are secrets managed and rotated? How are dependencies and images scanned and patched? How would we detect and contain a compromised credential? Vol. 10 covers security engineering in depth.

Reliability

How does it fail? The ability of a workload to perform its intended function correctly and consistently, and to recover from failures.

Design principles:

  • Automatically recover from failure: health checks, auto-replacement, failover driven by KPIs.
  • Test recovery procedures: restore backups, fail over regions, inject faults.
  • Scale horizontally to reduce the impact of any single failure.
  • Stop guessing capacity: autoscaling and load testing.
  • Manage change through automation.

Concrete practices: multi-AZ everything, static stability (chapter 85), timeouts/retries/circuit breakers/bulkheads (Vol. 3 ch. 52), idempotency (Vol. 5 ch. 74), graceful degradation, dependency mapping (what happens if X is down?), quotas and limits reviewed, cell-based architecture to bound blast radius (Vol. 12).

Disaster recovery strategies

Two numbers define recovery requirements:

  • RPO (recovery point objective): how much data loss is acceptable (time since last recoverable copy).
  • RTO (recovery time objective): how long the service may be unavailable.

Smaller RPO and RTO cost more:

cost and complexity →← RPO / RTO backup &restore backups copiedto region BRPO: hoursRTO: ≤ 24 h pilot light data replicated;compute off/minimalRPO: minutesRTO: 10s of min warm standby scaled-down copyrunning in BRPO: secondsRTO: minutes multi-siteactive-active both regions servetrafficRPO: ~0RTO: ~0
Disaster recovery strategies across regions, from cheapest and slowest to most expensive and fastest. Backup and restore keeps only backups in the second region; pilot light keeps data replicated and core infrastructure off; warm standby runs a scaled-down copy; multi-site active-active serves traffic from both regions.

Guidance:

  • Pick the strategy per workload from business impact (Vol. 12): not everything needs active-active.
  • DR protects against regional events; backups with immutability protect against logical disasters (bugs, deletions, ransomware) in any strategy.
  • Test failover regularly (at least yearly; quarterly for critical systems), including failing back, and include DNS, secrets, quotas, CI/CD and people in the test.
  • Mind dependencies on control planes and global services during regional failure (static stability, chapter 85).
  • Tools: AWS Elastic Disaster Recovery, Aurora Global Database and DynamoDB global tables, S3 CRR, Route 53 ARC; Azure Site Recovery, paired regions; GCP cross-region replication for Cloud SQL, Spanner multi-region.

Performance efficiency

How does it scale? What's the performance envelope? Using resources efficiently to meet requirements, and maintaining that as demand and technology change.

Design principles:

  • Democratise advanced technologies: use managed services (search, ML, CDN) rather than building them.
  • Go global in minutes: regions and edge locations near users.
  • Use serverless where it fits.
  • Experiment more often: try instance types (Graviton), databases, caching.
  • Consider mechanical sympathy: choose the technology that matches the access pattern (key-value vs relational, object vs block).

The performance envelope is the documented range within which the system meets its objectives:

  • Throughput limits: requests/s per instance, partitions in Kafka, write capacity of the primary database, API rate limits of dependencies.
  • Latency budgets: p50/p99 per tier, adding up to the user-facing target.
  • Scaling behaviour: what scales automatically, how fast, and up to which quotas; what doesn't scale (the single writer database).
  • Known bottlenecks and the next one: after the cache, what breaks first at 10× load?

Establish it with load testing (Vol. 11), capacity models (Little's law), and production telemetry; revisit after major changes.

Cost optimisation

What does it cost? Delivering business value at the lowest price point, and knowing what you spend on what.

Design principles:

  • Implement cloud financial management (FinOps): shared responsibility between engineering, finance and product.
  • Adopt a consumption model: pay for what you use; turn off what you don't (dev environments at night).
  • Measure overall efficiency: cost per business outcome (unit economics: cost per order, per active user, per GB processed).
  • Stop spending on undifferentiated heavy lifting: managed services.
  • Analyse and attribute expenditure: tagging, account structure, cost allocation.

Where cloud money goes, and levers

Area Levers
Compute Rightsize (most instances are over-provisioned; use utilisation data and recommenders such as Compute Optimizer and Azure Advisor), ARM/Graviton, autoscaling with sensible minimums, spot for tolerant work, savings plans / reservations / committed use for the steady baseline, scale non-production to zero outside working hours
Kubernetes Accurate requests (VPA recommendations), bin-packing (Karpenter consolidation), spot node pools, per-namespace cost allocation (OpenCost/Kubecost)
Storage Lifecycle to cheaper classes, Intelligent-Tiering, delete orphaned volumes and old snapshots, gp2 → gp3, retention limits on logs and backups
Data transfer Keep chatty services in the same AZ where safe; VPC endpoints instead of NAT for cloud services; CDN for egress; compress; avoid cross-region replication you don't need
Databases Rightsize, reserved instances, serverless for spiky loads, archive cold data, query optimisation (efficient queries are cheaper queries)
Observability Sample traces, drop noisy logs at the source, set retention, control metric cardinality
Licences Bring-your-own-licence rules, open-source alternatives (PostgreSQL vs commercial databases)

FinOps practices

  • Tag everything (team, service, environment, cost-centre) and enforce tags with policies; or allocate by account/subscription/project.
  • Budgets and anomaly detection (AWS Budgets and Cost Anomaly Detection, Azure Cost Management, GCP budgets) alerting the owning team.
  • Showback or chargeback dashboards per team; unit cost trends next to product metrics.
  • Cost in design reviews and pull requests: tools like Infracost estimate the cost of Terraform changes before merging.
  • Use the FOCUS specification (FinOps Open Cost and Usage Specification), now supported by the major clouds' billing exports, to analyse multi-cloud costs consistently.
HCL
# Terraform: a monthly budget with alerts to the owning team, and enforced tags via default_tags
provider "aws" {
  region = "ap-south-1"
  default_tags { tags = { team = "checkout", service = "orders", environment = "prod" } }
}

resource "aws_budgets_budget" "orders" {
  name         = "orders-prod-monthly"
  budget_type  = "COST"
  limit_amount = "4000"
  limit_unit   = "USD"
  time_unit    = "MONTHLY"
  cost_filter {
    name   = "TagKeyValue"
    values = ["user:service$orders"]
  }
  notification {
    comparison_operator        = "GREATER_THAN"
    threshold                  = 80
    threshold_type             = "PERCENTAGE"
    notification_type          = "FORECASTED"
    subscriber_email_addresses = ["checkout-team@acme.dev"]
  }
}

Sustainability

What's the environmental footprint? Minimising the energy and resources a workload consumes.

Design principles:

  • Understand your impact: provider carbon tools (AWS Customer Carbon Footprint Tool, Azure Emissions Impact Dashboard, Google Cloud Carbon Footprint).
  • Establish sustainability goals per workload (e.g. compute-hours per transaction).
  • Maximise utilisation: idle resources burn energy; consolidate, autoscale, scale to zero.
  • Use more efficient hardware and services: ARM processors use significantly less energy per unit of work; managed and serverless services share infrastructure efficiently.
  • Reduce downstream impact: smaller payloads, efficient client code, less data shipped to devices.

Practical choices that usually also cut cost:

  • Region selection by grid carbon intensity (some regions run on largely low-carbon electricity; Google publishes carbon-free energy percentages per region).
  • Time-shifting flexible batch jobs to low-carbon hours ("carbon-aware computing"; the Green Software Foundation's Carbon Aware SDK).
  • Data lifecycle: delete what you don't need; don't replicate or retain data without reason.
  • Right-size ML: smaller models, quantisation, batching, efficient accelerators (Vol. 14).

Sustainability and cost optimisation are mostly aligned: wasted capacity is both money and energy.

Comparing the frameworks

AWS Azure Google Cloud
Pillars 6 (incl. sustainability) 5 (sustainability as separate guidance) 5 pillars + perspectives (AI/ML, sustainability, industries)
Review tooling Well-Architected Tool (question sets, lenses, milestones, improvement plans) Azure Well-Architected Review assessment, Azure Advisor scores Architecture Center, Recommender
Lenses / specialisations Serverless, SaaS, financial services, ML, generative AI, IoT, container build, etc. Workload guides (AI, mission-critical, SaaS, Azure Virtual Desktop…) Industry and AI/ML perspectives
Related AWS Prescriptive Guidance, Builders' Library Cloud Adoption Framework, Azure Architecture Center Cloud Architecture Center, SRE books

The Amazon Builders' Library (articles on static stability, timeouts and retries, shuffle sharding, avoiding fallback, cell-based architecture) is particularly valuable for distributed-systems depth.

Running an architecture review

A lightweight, repeatable review for any significant design or change:

  1. Context: business goal, users, load (now and in 2 years), data sensitivity, regulatory constraints, availability and latency objectives (SLOs), RPO/RTO, budget.
  2. Diagram: components, data flows, trust boundaries, dependencies (including third parties), regions and AZs.
  3. Walk the six questions, recording risks and decisions (not just "yes we thought about it"):
Question Probing prompts
Operated? Who's on call? How do we deploy, roll back, observe, and know it's broken before users do?
Secured? Identities and permissions per component? Internet exposure? Data classification and encryption? Secrets? Supply chain?
Fails? What happens when each dependency is down or slow? AZ loss? Region loss? Bad deploy? Data corruption? What's the blast radius?
Scales? Which component saturates first at 10×? Is scaling automatic? Which quotas apply?
Costs? Monthly estimate, biggest drivers, cost per unit of business value, how it scales with load
Performance envelope? Latency budget per hop, throughput limits, how we'll verify (load tests)
  1. Prioritise risks (high-risk issues first), create improvement items with owners, and record decisions as Architecture Decision Records (Vol. 13).
  2. Revisit on major changes or at least annually; reviews are a habit, not an audit.

A worked example

A team proposes: "A single EC2 instance in one AZ running the API and PostgreSQL, with nightly snapshots, behind an Elastic IP."

Pillar Findings Improvements
Operations Manual deploys by SSH, no metrics beyond CPU Containerise, CI/CD to ECS, structured logs, SLO dashboards
Security SSH open to the internet, DB password in a config file, root on the instance SSM Session Manager, Secrets Manager with rotation, task roles, no inbound SSH
Reliability One instance, one AZ: any host or AZ failure is a full outage; RPO up to 24 h ALB + tasks in 3 AZs; RDS Multi-AZ with PITR (RPO minutes); test restore
Performance API and DB compete for CPU and memory; no headroom Separate tiers; autoscaling on request count; cache hot reads
Cost Cheap today; but instance oversized for nights and weekends Graviton, savings plan for baseline, scale to small minimum off-peak
Sustainability Large always-on instance mostly idle Right-size and autoscale

The improved design costs more per month, but the review makes the trade-off explicit: the business can decide whether a few hours of outage per incident and up to a day of data loss is acceptable for this workload.

Lab: a Well-Architected review of the tiffin stack

cdk-nag 2.38 (AwsSolutionsChecks) run against chapter 90's CDK app during synthesis, plus error-budget arithmetic and an indicative comparison of disaster-recovery strategies.

Experiment 1: the automated findings, sorted by pillar

cdk-nag evaluated 42 rules: 27 passed, 15 failed (listed in the on-ramp). Sorted by pillar, with a decision for each:

Pillar Findings Decision
Security RDS2 storage not encrypted; CFR4 old TLS allowed; SQS4 ×2 non-TLS requests allowed; SMG4 no secret rotation; CFR2 no WAF Fix all; WAF with AWS managed rule groups on CloudFront
Security / operations VPC7 no flow logs; ELB2, S1, CFR3 no access logs; ECS4 no Container Insights Fix: logs to a central, retention-limited bucket; Container Insights on
Reliability RDS10 no deletion protection Fix, plus backup retention 14 days and a tested restore
Not applicable EC23 public LB open to 0.0.0.0/0; CFR1 geo restriction; RDS11 default port Suppress with reasons: public entry point by design; global users; obscurity adds nothing

Two things automation didn't catch: the load balancer listens on plain HTTP (chapter 90's lab), and nothing checks whether the design meets its SLOs. Rule packs cover what's visible in configuration; reviews also need load tests, failure drills, cost data and conversations.

Experiment 2: error budgets and burn rates

Text
SLO 99.9% over 30 days: error budget 43.2 minutes, or 1,000 failed requests per million
2% of requests failing against a 99.9% SLO: burn rate 20× → the month's budget is gone in 2,160.0 minutes
half of requests failing against a 99.9% SLO: burn rate 500× → the month's budget is gone in 86.4 minutes

A 2% error rate sounds small but spends a month's budget in a day and a half; an outage failing half the requests spends it in under an hour and a half. That's why SRE practice alerts on burn rate over multiple windows (for example, page if the 1-hour burn rate exceeds 14.4× and the 5-minute rate confirms it; open a ticket for a slow 3-day burn), instead of fixed error-count thresholds that are either noisy or slow.

Experiment 3: choosing a disaster-recovery strategy

Indicative recovery time (RTO), data loss (RPO) and extra running cost for the stack in a second region:

Text
backup & restore (cross-region snapshots, IaC)   RTO hours      RPO hours (last backup)              extra cost ~5% (storage of copies)
pilot light (DB replica running, compute off)    RTO 10–30 min  RPO seconds–minutes                  extra cost ~15–25%
warm standby (scaled-down full copy running)     RTO minutes    RPO seconds                          extra cost ~40–60%
multi-site active/active                         RTO near zero  RPO near zero (or conflict handling) extra cost ~100%+

These are typical ranges, not measurements: real numbers come from drills. The choice follows the business impact: the tiffin centre losing ordering for an hour on a rare regional outage may be acceptable (backup and restore, or pilot light), while a payments platform may need warm standby. Whatever you choose, the reliability pillar's hardest rule applies: a recovery plan that hasn't been tested doesn't exist. Restore the backups and fail over on a schedule.

Try it yourself

  1. Apply the fixes in experiment 1 to the CDK app, add NagSuppressions with reasons for the rest, and get cdk-nag to zero unsuppressed findings.
  2. Run the AWS Well-Architected Tool's questions for the stack (in a real account, or from the published question list) and record high and medium risks.
  3. Write multi-window burn-rate alert rules (Prometheus or CloudWatch) for a 99.9% SLO.
  4. Plan a pilot-light DR for the stack: what must exist in the second region, how is it promoted, and how will you test it quarterly?

Revision sheet: Well-Architected thinking

Key ideas

  • Six pillars: operational excellence, security, reliability, performance efficiency, cost optimisation, sustainability; Azure WAF (five pillars) and Google Cloud's Architecture Framework ask similar questions.
  • Operational excellence: IaC, CI/CD, small reversible changes, observability, runbooks, game days, post-incident reviews.
  • Security: identity foundation, traceability (logs), defence in depth, data protection, automated detection and response.
  • Reliability: SLOs and error budgets, fault isolation (zones, cells), automatic recovery, tested backups, DR strategies (RTO/RPO), quotas and limits.
  • Performance efficiency: right resource types, caching, load testing, scaling, experimentation.
  • Cost optimisation: visibility (tags, cost allocation), rightsizing, pricing models, lifecycle, architecture choices (serverless vs always-on), FinOps.
  • Sustainability: utilisation, efficient hardware (Arm), region choice, data minimisation.
  • Reviews: questions, evidence, high/medium risks, improvement plans; automated checks plus human judgement; documented suppressions.

Numbers to remember

  • Error budgets for 30 days: 99% 432 min, 99.9% 43.2 min, 99.95% 21.6 min, 99.99% 4.3 min.
  • Lab: cdk-nag found 15 issues in 42 checks; a 2% error rate burns a 99.9% budget in 1.5 days, a 50% outage in 86 minutes.

Pitfalls

  • "Highly available" without an SLO.
  • DR plans never tested.
  • Suppressing findings without reasons, or fixing irrelevant ones.
  • Reviews done once and never revisited.
  • Optimising one pillar (cost) by silently sacrificing another (reliability).

Glossary

  • SLO / SLI: objective / the measured indicator.
  • Error budget: allowed unreliability under an SLO.
  • Burn rate: how fast the error budget is being consumed.
  • RTO / RPO: recovery time / recovery point objectives.
  • Pilot light / warm standby: DR strategies with minimal or scaled-down running copies.
  • Suppression: a documented, accepted exception to a rule.