AWS Learning
Fundamentals

AWS Well-Architected Framework

6 Pillars, Design Principles, Best Practices

Tổng quan

AWS Well-Architected Framework là bộ best practices và guidelines giúp bạn thiết kế và vận hành hệ thống trên AWS một cách reliable, secure, efficient, cost-effective, và sustainable.

Framework này được xây dựng từ kinh nghiệm của AWS Solutions Architects sau khi review hàng nghìn kiến trúc của khách hàng.

[!TIP] Framework không phải là audit mechanism mà là cuộc hội thoại mang tính xây dựng về các quyết định kiến trúc.


6 Pillars (Trụ cột)

┌──────────────────────────────────────────────────────────────────────────────┐
│                    AWS Well-Architected Framework                            │
├──────────────────────────────────────────────────────────────────────────────┤
│                                                                              │
│  ┌───────────────────────────────────────────────────────────────────────┐   │
│  │                         6 PILLARS                                     │   │
│  ├───────────────────────────────────────────────────────────────────────┤   │
│  │                                                                       │   │
│  │  ┌─────────────┐  ┌─────────────┐  ┌─────────────┐                     │  │
│  │  │ OPERATIONAL │  │  SECURITY   │  │ RELIABILITY │                     │  │
│  │  │ EXCELLENCE  │  │             │  │             │                     │  │
│  │  │      🔧     │  │      🔒     │  │      🛡️     │                     │  │
│  │  └─────────────┘  └─────────────┘  └─────────────┘                     │  │
│  │                                                                       │   │
│  │  ┌─────────────┐  ┌─────────────┐  ┌──────────────┐                    │  │
│  │  │ PERFORMANCE │  │    COST     │  │SUSTAINABILITY│                    │  │
│  │  │ EFFICIENCY  │  │OPTIMIZATION │  │              │                    │  │
│  │  │      ⚡      │  │      💰     │  │      🌱      │                   │  │
│  │  └─────────────┘  └─────────────┘  └──────────────┘                    │  │
│  │                                                                       │   │
│  └───────────────────────────────────────────────────────────────────────┘   │
│                                                                              │
└──────────────────────────────────────────────────────────────────────────────┘
PillarMô tả
Operational ExcellenceKhả năng vận hành và monitor hệ thống để deliver business value
SecurityBảo vệ data, systems, và assets
ReliabilityKhả năng hoạt động đúng chức năng một cách consistent
Performance EfficiencySử dụng tài nguyên hiệu quả
Cost OptimizationDeliver business value với chi phí thấp nhất
SustainabilityGiảm thiểu tác động môi trường

1. Operational Excellence (Vận hành xuất sắc)

Định nghĩa

Khả năng build software đúng cách và consistently deliver trải nghiệm tốt cho khách hàng, bao gồm:

  • Tổ chức team
  • Thiết kế workload
  • Vận hành ở scale lớn
  • Cải tiến liên tục

Design Principles

PrincipleMô tảAWS Services
Organize around business outcomesTổ chức team theo kết quả kinh doanh, không theo function-
Implement observabilityHiểu behavior, performance, reliability, cost của workloadCloudWatch, X-Ray, CloudTrail
Safely automateAutomate operations với guardrails, rate control, error thresholdsCloudFormation, CDK, Systems Manager
Make small, reversible changesDeploy incremental, có khả năng rollback nhanhCodePipeline, CodeDeploy
Refine procedures frequentlyCập nhật và validate procedures định kỳRunbooks, Playbooks
Anticipate failureTest failure scenarios để hiểu risk profileFault Injection Simulator
Learn from failuresPost-incident reviews, share lessons learned-
Use managed servicesGiảm operational burdenLambda, Fargate, RDS

Best Practices Areas

┌─────────────────────────────────────────────────────────────────────────────┐
│                    Operational Excellence Areas                             │
├─────────────────────────────────────────────────────────────────────────────┤
│                                                                             │
│  ┌─────────────┐     ┌─────────────┐     ┌─────────────┐                    │
│  │   ORGANIZE  │     │   PREPARE   │     │   OPERATE   │                    │
│  │             │     │             │     │             │                    │
│  │ • Team      │ ──► │ • Design    │ ──► │ • Monitor   │                    │
│  │   structure │     │   telemetry │     │ • Respond   │                    │
│  │ • Culture   │     │ • Runbooks  │     │ • Events    │                    │
│  │ • KPIs      │     │ • Test      │     │ • Incidents │                    │
│  └─────────────┘     └─────────────┘     └─────────────┘                    │
│                                                 │                           │
│                                                 ▼                           │
│                                    ┌─────────────┐                          │
│                                    │   EVOLVE    │                          │
│                                    │             │                          │
│                                    │ • Learn     │                          │
│                                    │ • Improve   │                          │
│                                    │ • Share     │                          │
│                                    └─────────────┘                          │
│                                                                             │
└─────────────────────────────────────────────────────────────────────────────┘

2. Security (Bảo mật)

Định nghĩa

Khả năng bảo vệ data, systems, và assets để tận dụng cloud technologies cải thiện security.

Design Principles

PrincipleMô tảAWS Services
Strong identity foundationLeast privilege, separation of duties, no long-term credentialsIAM, Organizations, SSO
Maintain traceabilityMonitor, alert, audit real-timeCloudTrail, CloudWatch, Config
Apply security at all layersDefense in depth - network, VPC, instance, OS, codeSecurity Groups, WAF, Shield
Automate security best practicesSecurity controls as codeCloudFormation, Config Rules
Protect data in transit and at restEncryption, tokenization, access controlKMS, ACM, Secrets Manager
Keep people away from dataReduce direct access và manual processingSystems Manager, Lambda
Prepare for security eventsIncident response plans, simulationsGuardDuty, Detective, Macie

Security Best Practices Areas

┌─────────────────────────────────────────────────────────────────────────────┐
│                       Security Areas                                        │
├─────────────────────────────────────────────────────────────────────────────┤
│                                                                             │
│  ┌─────────────────────────────────────────────────────────────────────┐    │
│  │                     Identity & Access Management                    │    │
│  │  IAM Users/Roles → Organizations → SSO → MFA                        │    │
│  └─────────────────────────────────────────────────────────────────────┘    │
│                                    │                                        │
│                                    ▼                                        │
│  ┌─────────────┐     ┌─────────────┐     ┌─────────────┐                    │
│  │  Detection  │     │Infrastructure│     │    Data    │                    │
│  │             │     │  Protection │     │ Protection  │                    │
│  │ • GuardDuty │     │ • VPC       │     │ • KMS       │                    │
│  │ • CloudTrail│     │ • WAF       │     │ • Macie     │                    │
│  │ • Config    │     │ • Shield    │     │ • Secrets   │                    │
│  │ • Detective │     │ • Firewall  │     │   Manager   │                    │
│  └─────────────┘     └─────────────┘     └─────────────┘                    │
│                                    │                                        │
│                                    ▼                                        │
│  ┌─────────────────────────────────────────────────────────────────────┐    │
│  │                    Incident Response                                │    │
│  │  Detection → Investigation → Containment → Recovery → Lessons       │    │
│  └─────────────────────────────────────────────────────────────────────┘    │
│                                                                             │
└─────────────────────────────────────────────────────────────────────────────┘

3. Reliability (Độ tin cậy)

Định nghĩa

Khả năng của workload thực hiện đúng chức năng một cách correctly và consistently khi expected, bao gồm khả năng vận hành và test xuyên suốt lifecycle.

Design Principles

PrincipleMô tảAWS Services
Automatically recover from failureMonitor KPIs, automate recoveryCloudWatch Alarms, Auto Scaling
Test recovery proceduresSimulate failures, validate recoveryFault Injection Simulator
Scale horizontallyMultiple small resources thay vì 1 large resourceELB, Auto Scaling
Stop guessing capacityMonitor và auto-scale theo demandAuto Scaling, Compute Optimizer
Manage change through automationInfrastructure as CodeCloudFormation, CDK

Reliability Best Practices Areas

┌─────────────────────────────────────────────────────────────────────────────┐
│                       Reliability Areas                                     │
├─────────────────────────────────────────────────────────────────────────────┤
│                                                                             │
│  ┌─────────────────────────────────────────────────────────────────────┐    │
│  │                         Foundations                                 │    │
│  │  Service Quotas → Network Topology → Service Limits                 │    │
│  └─────────────────────────────────────────────────────────────────────┘    │
│                                    │                                        │
│          ┌─────────────────────────┼─────────────────────────┐              │
│          ▼                         ▼                         ▼              │
│  ┌─────────────┐          ┌─────────────┐           ┌─────────────┐         │
│  │  Workload   │          │   Change    │           │   Failure   │         │
│  │ Architecture│          │ Management  │           │ Management  │         │
│  │             │          │             │           │             │         │
│  │ • Design for│          │ • IaC       │           │ • Backup    │         │
│  │   failures  │          │ • CI/CD     │           │ • DR        │         │
│  │ • Loose     │          │ • Testing   │           │ • Self-heal │         │
│  │   coupling  │          │ • Rollback  │           │ • Chaos     │         │
│  └─────────────┘          └─────────────┘           └─────────────┘         │
│                                                                             │
└─────────────────────────────────────────────────────────────────────────────┘

Reliability Concepts

ConceptĐịnh nghĩaTarget
Availability% thời gian workload available99.9% - 99.999%
RTORecovery Time Objective - thời gian phục hồiMinutes - Hours
RPORecovery Point Objective - data loss acceptableSeconds - Hours
MTTRMean Time To Recovery< 1 hour
MTBFMean Time Between Failures> 1 month

4. Performance Efficiency (Hiệu năng)

Định nghĩa

Khả năng sử dụng tài nguyên cloud hiệu quả để đáp ứng performance requirements và maintain efficiency khi demand thay đổi.

Design Principles

PrincipleMô tảAWS Services
Democratize advanced technologiesConsume technology as a serviceAI/ML services, DynamoDB
Go global in minutesDeploy multi-region cho low latencyGlobal Accelerator, CloudFront
Use serverless architecturesKhông cần manage serversLambda, Fargate, S3
Experiment more oftenTest different configurations dễ dàngEC2, A/B Testing
Consider mechanical sympathyChọn technology phù hợp với use caseDatabase selection

Performance Efficiency Areas

┌─────────────────────────────────────────────────────────────────────────────┐
│                    Performance Efficiency Areas                             │
├─────────────────────────────────────────────────────────────────────────────┤
│                                                                             │
│  ┌─────────────┐     ┌─────────────┐     ┌─────────────────────┐            │
│  │  Compute    │     │   Storage   │     │      Database       │            │
│  │             │     │             │     │                     │            │
│  │ • EC2 types │     │ • S3 classes│     │ • RDS vs DynamoDB   │            │
│  │ • Lambda    │     │ • EBS types │     │ • Read replicas     │            │
│  │ • Container │     │ • FSx       │     │ • Caching           │            │
│  │ • Graviton  │     │ • S3 Express│     │ • DAX, ElastiCache  │            │
│  └─────────────┘     └─────────────┘     └─────────────────────┘            │
│                                                                             │
│  ┌────────────────────────────────────────────────────────────────────┐     │
│  │                   Networking & Content Delivery                    │     │
│  │  VPC → ELB → CloudFront → Global Accelerator → Route 53            │     │
│  └────────────────────────────────────────────────────────────────────┘     │
│                                                                             │
└─────────────────────────────────────────────────────────────────────────────┘

Selection Guide

Workload TypeRecommended Services
Stateless, event-drivenLambda, API Gateway
Web applicationECS Fargate, ALB
High performance computingEC2 (C instances), Parallel Cluster
Big data processingEMR, Glue
Real-time processingKinesis, MSK
Static contentCloudFront, S3

5. Cost Optimization (Tối ưu chi phí)

Định nghĩa

Khả năng run systems để deliver business value với chi phí thấp nhất.

Design Principles

PrincipleMô tảAWS Services
Implement Cloud Financial ManagementInvest in FinOps capabilityCost Explorer, Budgets
Adopt a consumption modelPay only for what you useAuto Scaling, Lambda
Measure overall efficiencyBusiness output / costCloudWatch, custom metrics
Stop spending on undifferentiated heavy liftingUse managed servicesRDS, Lambda, Fargate
Analyze and attribute expenditureCost allocation, taggingCost Explorer, Tags

Cost Optimization Areas

┌─────────────────────────────────────────────────────────────────────────────┐
│                    Cost Optimization Areas                                  │
├─────────────────────────────────────────────────────────────────────────────┤
│                                                                             │
│  ┌─────────────────────────────────────────────────────────────────────┐    │
│  │                    Cloud Financial Management                       │    │
│  │  Budgeting → Forecasting → Cost Allocation → Optimization           │    │
│  └─────────────────────────────────────────────────────────────────────┘    │
│                                    │                                        │
│          ┌─────────────────────────┼─────────────────────────┐              │
│          ▼                         ▼                         ▼              │
│  ┌─────────────┐          ┌──────────────┐           ┌─────────────┐        │
│  │ Expenditure │          │Cost-effective│           │ Resource    │        │
│  │ Awareness   │          │ Resources    │           │ Right-sizing│        │
│  │             │          │              │           │             │        │
│  │ • Tagging   │          │ • Reserved   │           │ • Compute   │        │
│  │ • Budgets   │          │   Instances  │           │   Optimizer │        │
│  │ • Reports   │          │ • Spot       │           │ • Trusted   │        │
│  │ • Alerts    │          │ • Savings    │           │   Advisor   │        │
│  │             │          │   Plans      │           │             │        │
│  └─────────────┘          └──────────────┘           └─────────────┘        │
│                                                                             │
└─────────────────────────────────────────────────────────────────────────────┘

Pricing Models

ModelUse CaseDiscount
On-DemandUnpredictable workloads0%
Reserved InstancesSteady-state, predictable30-72%
Savings PlansConsistent usage commitment30-72%
Spot InstancesFault-tolerant, flexible60-90%
Dedicated HostsLicense complianceVaries

6. Sustainability (Bền vững)

Định nghĩa

Tập trung vào environmental impacts, đặc biệt là energy consumption và efficiency.

Design Principles

PrincipleMô tả
Understand your impactMeasure và model cloud workload impact
Establish sustainability goalsLong-term goals cho từng workload
Maximize utilizationRight-size, 60% utilization tốt hơn 30%
Anticipate and adopt efficient hardwareGraviton, new instance types
Use managed servicesShare resources, maximize utilization
Reduce downstream impactReduce energy cần để sử dụng services

Sustainability Best Practices

┌─────────────────────────────────────────────────────────────────────────────┐
│                    Sustainability Areas                                     │
├─────────────────────────────────────────────────────────────────────────────┤
│                                                                             │
│  ┌─────────────┐     ┌─────────────┐     ┌─────────────────────┐            │
│  │   Region    │     │   Compute   │     │     Storage         │            │
│  │  Selection  │     │             │     │                     │            │
│  │             │     │ • Graviton  │     │ • S3 Lifecycle      │            │
│  │ • Low carbon│     │ • Right-size│     │ • Intelligent-      │            │
│  │   regions   │     │ • Serverless│     │   Tiering           │            │
│  │ • Proximity │     │ • Spot      │     │ • Data lifecycle    │            │
│  └─────────────┘     └─────────────┘     └─────────────────────┘            │
│                                                                             │
│  ┌─────────────┐     ┌─────────────┐     ┌─────────────────────┐            │
│  │    Data     │     │   Network   │     │   Development       │            │
│  │ Management  │     │             │     │                     │            │
│  │             │     │ • Compression│     │ • Efficient code   │            │
│  │ • Minimize  │     │ • Caching   │     │ • Remove unused     │            │
│  │   data move │     │ • Edge      │     │   resources         │            │
│  └─────────────┘     └─────────────┘     └─────────────────────┘            │
│                                                                             │
└─────────────────────────────────────────────────────────────────────────────┘

AWS Sustainability Initiatives

InitiativeMô tả
100% Renewable EnergyMục tiêu năm 2025 cho all operations
Graviton ProcessorsUp to 60% energy efficient hơn x86
Customer Carbon Footprint ToolTrack carbon emissions
AWS Water+Trả lại nhiều nước hơn sử dụng by 2030

AWS Well-Architected Tool

Tổng quan

AWS cung cấp AWS Well-Architected Tool (miễn phí) để review workloads:

┌─────────────────────────────────────────────────────────────────────────────┐
│                    AWS Well-Architected Tool                                │
├─────────────────────────────────────────────────────────────────────────────┤
│                                                                             │
│  ┌─────────────────────────────────────────────────────────────────────┐    │
│  │  1. Define Workload                                                 │    │
│  │     Name, description, industry, environment                        │    │
│  └─────────────────────────────────────────────────────────────────────┘    │
│                                    │                                        │
│                                    ▼                                        │
│  ┌─────────────────────────────────────────────────────────────────────┐    │
│  │  2. Answer Questions                                                │    │
│  │     Questions cho mỗi pillar                                        │    │
│  └─────────────────────────────────────────────────────────────────────┘    │
│                                    │                                        │
│                                    ▼                                        │
│  ┌─────────────────────────────────────────────────────────────────────┐    │
│  │  3. Review Report                                                   │    │
│  │     • High Risk Issues (HRI)                                        │    │
│  │     • Medium Risk Issues (MRI)                                      │    │
│  │     • Improvement Plan                                              │    │
│  └─────────────────────────────────────────────────────────────────────┘    │
│                                    │                                        │
│                                    ▼                                        │
│  ┌─────────────────────────────────────────────────────────────────────┐    │
│  │  4. Implement Improvements                                          │    │
│  │     Track milestones, update review                                 │    │
│  └─────────────────────────────────────────────────────────────────────┘    │
│                                                                             │
└─────────────────────────────────────────────────────────────────────────────┘

Lenses

Ngoài Framework chính, AWS cung cấp Lenses cho specific use cases:

LensFocus Area
Serverless LensLambda, API Gateway, Step Functions
SaaS LensMulti-tenant SaaS applications
Machine Learning LensML workloads
Data Analytics LensAnalytics và big data
IoT LensInternet of Things
SAP LensSAP on AWS
Games LensGaming workloads
Financial Services LensFinancial industries

Trade-offs giữa các Pillars

┌─────────────────────────────────────────────────────────────────────────────┐
│                    Common Trade-offs                                        │
├─────────────────────────────────────────────────────────────────────────────┤
│                                                                             │
│  Performance vs Cost                                                        │
│  ─────────────────                                                          │
│  • Larger instances = Better performance = Higher cost                      │
│  • Multi-AZ = Higher availability = Higher cost                             │
│  • Reserved Instances = Lower cost = Less flexibility                       │
│                                                                             │
│  Security vs Performance                                                    │
│  ──────────────────────                                                     │
│  • More encryption = More CPU overhead                                      │
│  • More logging = More storage                                              │
│  • Stricter access = More latency                                           │
│                                                                             │
│  Reliability vs Cost                                                        │
│  ─────────────────                                                          │
│  • Multi-region DR = Higher cost                                            │
│  • More backups = More storage cost                                         │
│  • Redundancy = Higher cost                                                 │
│                                                                             │
│  Sustainability vs Performance                                              │
│  ────────────────────────────                                               │
│  • Right-sizing = May reduce peak performance                               │
│  • Cold storage = Higher retrieval latency                                  │
│                                                                             │
└─────────────────────────────────────────────────────────────────────────────┘

Ví dụ thực tế: E-commerce Application

Architecture Review

┌──────────────────────────────────────────────────────────────────────────────┐
│                    E-commerce Well-Architected Review                        │
├──────────────────────────────────────────────────────────────────────────────┤
│                                                                              │
│  Pillar: Operational Excellence                                              │
│  ┌─────────────────────────────────────────────────────────────────────┐     │
│  │  ✅ Infrastructure as Code (CloudFormation)                         │     │
│  │  ✅ CI/CD Pipeline (CodePipeline)                                   │     │
│  │  ✅ Centralized logging (CloudWatch Logs)                           │     │
│  │  ⚠️ Missing runbooks for common failures                            │     │
│  └─────────────────────────────────────────────────────────────────────┘     │
│                                                                              │
│  Pillar: Security                                                            │
│  ┌─────────────────────────────────────────────────────────────────────┐     │
│  │  ✅ IAM Roles (no access keys in code)                              │     │
│  │  ✅ Encryption at rest (KMS)                                        │     │
│  │  ✅ WAF enabled on CloudFront                                       │     │
│  │  ⚠️ No secrets rotation configured                                  │     │
│  └─────────────────────────────────────────────────────────────────────┘     │
│                                                                              │
│  Pillar: Reliability                                                         │
│  ┌─────────────────────────────────────────────────────────────────────┐     │
│  │  ✅ Multi-AZ deployment                                             │     │
│  │  ✅ Auto Scaling configured                                         │     │
│  │  ✅ RDS Multi-AZ                                                    │     │
│  │  ⚠️ No cross-region DR plan                                         │     │
│  └─────────────────────────────────────────────────────────────────────┘     │
│                                                                              │
│  Pillar: Performance Efficiency                                              │
│  ┌─────────────────────────────────────────────────────────────────────┐     │
│  │  ✅ CloudFront for static content                                   │     │
│  │  ✅ ElastiCache for session caching                                 │     │
│  │  ⚠️ Database queries not optimized                                  │     │
│  │  ⚠️ No performance testing in CI/CD                                 │     │
│  └─────────────────────────────────────────────────────────────────────┘     │
│                                                                              │
│  Pillar: Cost Optimization                                                   │
│  ┌─────────────────────────────────────────────────────────────────────┐     │
│  │  ⚠️ No Reserved Instances for production                            │     │
│  │  ✅ S3 Lifecycle policies configured                                │     │
│  │  ⚠️ Dev environment runs 24/7                                       │     │
│  │  ⚠️ No cost allocation tags                                         │     │
│  └─────────────────────────────────────────────────────────────────────┘     │
│                                                                              │
│  Pillar: Sustainability                                                      │
│  ┌─────────────────────────────────────────────────────────────────────┐     │
│  │  ⚠️ Not using Graviton instances                                    │     │
│  │  ⚠️ Dev resources not scheduled                                     │     │
│  │  ✅ S3 Intelligent-Tiering enabled                                  │     │
│  └─────────────────────────────────────────────────────────────────────┘     │
│                                                                              │
└──────────────────────────────────────────────────────────────────────────────┘

Well-Architected Labs

AWS cung cấp hands-on labs miễn phí: wellarchitectedlabs.com

CategoryLabs
Operational ExcellenceInventory and Patch Compliance, Event-Driven Architecture
SecurityQuest: Identity, Quest: Quick Wins
ReliabilityTesting Resiliency, Backup and Recovery
Performance EfficiencyPerformance Testing, Right-sizing
Cost OptimizationAWS Account Setup, Expenditure Awareness
SustainabilityCarbon Footprint, Optimization

Resources

ResourceLink
Framework Documentationdocs.aws.amazon.com/wellarchitected
Well-Architected ToolAWS Console
Pillar WhitepapersAWS Whitepapers
Well-Architected Labswellarchitectedlabs.com
Partner ProgramAWS Well-Architected Partners

Tổng kết

PillarKey FocusKey Question
Operational ExcellenceOperations, automation, continuous improvementLàm sao để vận hành và cải tiến workload?
SecurityProtection, compliance, incident responseLàm sao để bảo vệ data và systems?
ReliabilityAvailability, recovery, change managementLàm sao để đảm bảo workload luôn available?
Performance EfficiencyRight resources, global reach, monitoringLàm sao để sử dụng resources hiệu quả?
Cost OptimizationFinOps, right-sizing, pricing modelsLàm sao để deliver value với chi phí thấp nhất?
SustainabilityEnvironmental impact, efficiencyLàm sao để giảm environmental footprint?

[!IMPORTANT] Well-Architected không phải là một lần review mà là continuous process. Review workloads định kỳ và update khi có thay đổi significant.

[!TIP] Sử dụng AWS Well-Architected Tool (miễn phí) để track reviews và theo dõi improvement plan.