devHọc Dev
EN
Bài học

Tuần 1 - Ngày 3: Well-Architected Overview, Operational Excellence, Security và Reliability

Tuần 1 – Ngày 3

Bài này gộp 4 chủ đề: AWS Well-Architected Framework Overview, Operational Excellence Pillar, Security Pillar, Reliability Pillar.

Mục tiêu học tập

  • Hiểu tổng quan về Well-Architected Framework
  • Nắm được 6 pillars và mối quan hệ giữa chúng
  • Biết cách sử dụng Well-Architected Tool
  • Hiểu design principles của Operational Excellence
  • Nắm các best practices cho operations
  • Biết các AWS services hỗ trợ pillar này
  • Hiểu design principles của Security pillar
  • Nắm vững 7 focus areas (best practice areas) của Security
  • Biết các AWS services cho security
  • Hiểu design principles của Reliability pillar
  • Nắm các concepts: RTO, RPO, fault tolerance
  • Biết các patterns cho high availability

Phần 1: AWS Well-Architected Framework Overview

1. Giới thiệu Well-Architected Framework

Định nghĩa

Well-Architected Framework là tập hợp các best practices và design principles giúp:

  • Đánh giá và cải thiện kiến trúc cloud
  • Hiểu trade-offs trong các quyết định thiết kế
  • Xây dựng secure, high-performing, resilient, efficient systems

Lịch sử phát triển

2015 (Oct): Ra mắt với 4 pillars
            (Security, Reliability, Performance Efficiency, Cost Optimization)
2016 (Nov): Thêm Operational Excellence pillar (→ 5 pillars)
2021 (Dec): Thêm Sustainability pillar (→ 6 pillars hiện tại)

2. Sáu Pillars của Well-Architected

┌─────────────────────────────────────────────────────────────────┐│WELL-ARCHITECTEDFRAMEWORK│├─────────────┬─────────────┬─────────────┬─────────────┬─────────┤│Operational│Security│Reliability│Performance│Cost││Excellence│││Efficiency│Optimize│├─────────────┴─────────────┴─────────────┴─────────────┴─────────┤│Sustainability│└─────────────────────────────────────────────────────────────────┘

Tổng quan 6 Pillars

PillarFocusKey Question
Operational ExcellenceChạy và monitor systems"Làm sao để vận hành hiệu quả?"
SecurityBảo vệ data và systems"Làm sao để bảo mật?"
ReliabilityPhục hồi từ failures"Làm sao để đảm bảo uptime?"
Performance EfficiencySử dụng resources hiệu quả"Làm sao để đạt hiệu suất?"
Cost OptimizationTránh chi phí không cần thiết"Làm sao để tiết kiệm?"
SustainabilityGiảm environmental impact"Làm sao để bền vững?"

3. Design Principles chung

1. Stop guessing capacity needs

Trước:Sau:┌─────────────┐┌─────────────┐│PeakLoad││AutoScale││████████││████││████████│──────────►│████████││Wasted$$││████│└─────────────┘└─────────────┘ProvisionUsewhatforpeakyouneed

2. Test systems at production scale

  • Có thể tạo production-scale test environment
  • Chỉ trả tiền khi test
  • Terminate sau khi test xong

3. Automate to make experimentation easier

  • Infrastructure as Code
  • Automated testing
  • CI/CD pipelines

4. Allow for evolutionary architectures

  • Thiết kế cho thay đổi
  • Loose coupling
  • Modular components

5. Drive architectures using data

  • Collect metrics
  • Make data-driven decisions
  • Continuous improvement

6. Improve through game days

  • Simulate production events
  • Test incident response
  • Build confidence

4. Trade-offs giữa các Pillars

Security vs Performance

MoreSecurityLayers=HigherLatency┌──────────┐┌──────────┐┌──────────┐┌──────────┐│WAF│──►│ALB│──►│EC2│──►│RDS│└──────────┘└──────────┘└──────────┘└──────────┘+2ms+1ms+1ms+1msTotal:+5msTrade-off:Chấpnhậnlatencycaohơnđểcósecuritytốthơn

Cost vs Reliability

Higher Availability = Higher Cost

99.9% (3 nines):    Single AZ deployment      $
99.99% (4 nines):   Multi-AZ deployment       $$
99.999% (5 nines):  Multi-Region deployment   $$$

Trade-off: Xác định acceptable downtime vs budget

Performance vs Cost

On-Demand Capacity:
- Instant performance scaling
- Pay premium for flexibility

Reserved Capacity:
- Commit for discount
- May not scale as quickly

Trade-off: Flexibility vs cost savings

5. Well-Architected Tool

Cách sử dụng

  1. Định nghĩa workload trong AWS Console
  2. Trả lời câu hỏi cho mỗi pillar
  3. Review risks được xác định
  4. Tạo improvement plan
  5. Track progress theo thời gian

Workflow

DefineWorkload──►AnswerQuestions──►ReviewRisks│││▼│GenerateImprovementPlan││└──────────────────────────────────────┘TrackProgress

Output của Tool

  • High Risk Issues (HRIs)
  • Medium Risk Issues (MRIs)
  • Improvement plan với priorities
  • PDF report để share

6. Well-Architected Lenses

Standard Lenses

  • Serverless Lens
  • SaaS Lens
  • Container Build Lens
  • Data Analytics Lens
  • Machine Learning Lens
  • IoT Lens
  • Financial Services Lens
  • Healthcare Lens
  • Games Industry Lens

Custom Lenses

  • Tạo lenses riêng cho tổ chức
  • Thêm questions và best practices specific
  • Share across accounts

7. Câu hỏi trong kỳ thi

Dạng câu hỏi thường gặp

  1. Xác định pillar: "Scenario này liên quan đến pillar nào?"
  2. Trade-off: "Giải pháp nào cân bằng tốt nhất giữa X và Y?"
  3. Best practice: "Áp dụng design principle nào?"

Ví dụ

Câu hỏi: Một công ty muốn giảm chi phí nhưng vẫn đảm bảo 99.99% availability. Giải pháp nào phù hợp?

Phân tích:

  • Cost Optimization: Tìm cách giảm chi phí
  • Reliability: Vẫn cần high availability
  • Trade-off: Dùng Reserved Instances cho baseline, Spot cho burst

Phần 2: Operational Excellence Pillar

1. Định nghĩa Operational Excellence

Khả năng chạy và monitor systems để deliver business value và liên tục cải tiến supporting processes và procedures.

4 Focus Areas

  1. Organization
  2. Prepare
  3. Operate
  4. Evolve

2. Design Principles

1. Perform operations as code

Trước (Manual):                 Sau (Infrastructure as Code):
- SSH vào server               - CloudFormation templates
- Manually configure           - Terraform
- Document steps               - AWS CDK
- Human error prone            - Version controlled
                               - Repeatable

2. Make frequent, small, reversible changes

BigBangRelease:SmallIncrementalChanges:┌────────────────┐┌──┐┌──┐┌──┐┌──┐│││││││││││LargeChange│vs│v1││v2││v3││v4│││││││││││└────────────────┘└──┘└──┘└──┘└──┘HighRiskLowRiskEach

3. Refine operations procedures frequently

  • Regularly review procedures
  • Update based on lessons learned
  • Conduct game days

4. Anticipate failure

  • Pre-mortem exercises
  • Test failure scenarios
  • Chaos engineering

5. Learn from all operational failures

  • Post-incident reviews (PIR)
  • Share lessons across teams
  • Implement improvements

3. Organization

Team Structure

┌─────────────────────────────────────────────┐│ProductTeam││┌─────────┐┌─────────┐┌─────────┐│││Dev││Ops││Security│││││││││││└────┬────┘└────┬────┘└────┬────┘││└────────────┼────────────┘│││││SharedResponsibility│└─────────────────────────────────────────────┘

AWS Services

  • AWS Organizations: Quản lý multiple accounts
  • AWS Control Tower: Setup landing zone
  • Service Catalog: Standardized products

4. Prepare

Infrastructure as Code

# CloudFormation Example
AWSTemplateFormatVersion: '2010-09-09'
Resources:
  WebServer:
    Type: AWS::EC2::Instance
    Properties:
      InstanceType: t3.micro
      ImageId: ami-0123456789abcdef0
      Tags:
        - Key: Environment
          Value: Production

Deployment Strategies

StrategyRiskRollback TimeUse Case
All-at-onceHighMinutesDev/Test
RollingMediumMinutesProduction
Blue/GreenLowSecondsMission Critical
CanaryVery LowSecondsHigh-risk changes

AWS Services

  • CloudFormation: Infrastructure as Code
  • AWS CDK: Code-first approach
  • CodePipeline: CI/CD
  • CodeDeploy: Deployment automation
  • Systems Manager: Configuration management

5. Operate

Monitoring Hierarchy

┌─────────────────────────────────────────────────┐│CloudWatch││┌─────────────┐┌─────────────┐┌─────────┐│││Metrics││Logs││Alarms││││││││││││CPU,Memory││AppLogs││>80%CPU││││Disk,Net││AccessLogs││Errors│││└─────────────┘└─────────────┘└─────────┘│││││││└────────────────┼───────────────┘││▼││┌─────────────┐│││Dashboards│││└─────────────┘│└─────────────────────────────────────────────────┘

Runbook vs Playbook

RunbookPlaybook
Step-by-step proceduresDecision trees
"How to do X""When Y happens, do Z"
Routine tasksIncident response
Can be automatedMay need judgment

AWS Services for Operations

  • CloudWatch: Metrics, Logs, Alarms, Dashboards
  • X-Ray: Distributed tracing
  • AWS Config: Configuration tracking
  • CloudTrail: API logging
  • EventBridge: Event routing
  • Systems Manager: Operational tasks

6. Evolve

Continuous Improvement Cycle

┌──────────────┐│Measure│└──────┬───────┘│▼┌──────────────┐│Analyze│└──────┬───────┘│▼┌──────────────┐│Improve│└──────┬───────┘│└──────────────┐│┌──────────────┐││Measure│◄─────┘└──────────────┘

Metrics to Track

  1. Deployment frequency: Số lần deploy
  2. Lead time: Thời gian từ commit đến production
  3. MTTR: Mean Time To Recovery
  4. Change failure rate: % deployments fail

Game Days

  • Simulate failures in controlled environment
  • Test runbooks and procedures
  • Build team confidence
  • Example: Chaos Engineering với AWS Fault Injection Simulator

7. Key AWS Services Summary

AreaServices
OrganizationOrganizations, Control Tower, Service Catalog
PrepareCloudFormation, CDK, CodePipeline, CodeDeploy
OperateCloudWatch, X-Ray, Config, CloudTrail, SSM
EvolveWell-Architected Tool, Trusted Advisor

8. Common Exam Questions

Question Type 1: Tool Selection

Company cần automate deployment với zero-downtime. Service nào?

  • Answer: CodeDeploy với Blue/Green deployment

Question Type 2: Best Practice

Làm sao để ensure consistent configuration across environments?

  • Answer: Infrastructure as Code (CloudFormation/CDK)

Question Type 3: Monitoring

Cần trace requests across microservices. Service nào?

  • Answer: AWS X-Ray

Phần 3: Security Pillar

1. Định nghĩa Security Pillar

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

7 Focus Areas (best practice areas)

  1. Security Foundations
  2. Identity and Access Management
  3. Detection
  4. Infrastructure Protection
  5. Data Protection
  6. Incident Response
  7. Application Security — tích hợp security vào vòng đời phát triển: threat modeling, SAST/DAST, kiểm tra dependency, security review trong CI/CD (vd Amazon Inspector code scanning, CodeGuru Security, pipeline gate)

Whitepaper bản cũ chỉ có 6 area; Application Security được bổ sung ở các bản cập nhật gần đây. Đề thi có thể vẫn dùng cách chia cũ — nắm cả 7 để không bị bất ngờ.

2. Design Principles

1. Implement a strong identity foundation

Best Practice:
- Least privilege access
- Centralized identity management (IAM Identity Center)
- No long-term credentials
- Regular permission review

2. Enable traceability

┌─────────────────────────────────────────────┐│Logging&Monitoring││┌───────────┐┌───────────┐┌─────────┐│││CloudTrail││VPCFlow││Config││││││Logs││││││APIcalls││Network││Changes│││└─────┬─────┘└─────┬─────┘└────┬────┘││└──────────────┼─────────────┘││▼││┌─────────────────┐│││Centralized││││LogAnalysis││││(CloudWatch)│││└─────────────────┘│└─────────────────────────────────────────────┘

3. Apply security at all layers

Edge Security       → CloudFront, WAF, Shield
Network Security    → VPC, Security Groups, NACLs
Compute Security    → EC2 Instance Profile, Inspector
Application         → Secrets Manager, Parameter Store
Data Security       → KMS, S3 Encryption

4. Automate security best practices

  • Security as Code
  • Automated patching
  • Automated response to incidents
  • Compliance checks

5. Protect data in transit and at rest

InTransit:AtRest:┌─────────┐┌─────────┐│TLS││KMS││1.2/1.3││Keys│└─────────┘└─────────┘││HTTPSEncryptedVPN/IPSecStorage

6. Keep people away from data

  • Automate processing
  • Reduce direct access
  • Audit when access is needed

7. Prepare for security events

  • Incident response plan
  • Regular drills
  • Forensic capabilities

3. Security Foundations

Shared Responsibility Model

┌─────────────────────────────────────────────┐│CustomerResponsibility││(SecurityINtheCloud)││-CustomerData││-Platform,Applications,IAM││-OperatingSystem,NetworkConfig││-Client-side&Server-sideEncryption│├─────────────────────────────────────────────┤│AWSResponsibility││(SecurityOFtheCloud)││-Hardware,Software,Networking││-Compute,Storage,Database,Networking││-Regions,AZs,EdgeLocations│└─────────────────────────────────────────────┘

Account Structure

┌─────────────────┐│Management││Account│└────────┬────────┘│┌────────────────────┼────────────────────┐│││▼▼▼┌──────────────┐┌──────────────┐┌──────────────┐│Security││Production││Dev││Account││Account││Account││││││││-GuardDuty││-Workloads││-Sandbox││-Security││-Data││-Testing││Hub│││││└──────────────┘└──────────────┘└──────────────┘

4. Identity and Access Management

IAM Identity Center (AWS SSO)

┌────────────────────────────────────────┐│IAMIdentityCenter││││┌──────────────┐┌──────────────┐│││Built-in││External││││Directory││IdP││││││(Okta,AD)│││└──────┬───────┘└──────┬───────┘││└──────────────────┘│││││▼││┌──────────────────┐│││PermissionSets││││(Roles)│││└──────────────────┘│││││┌───────────────┼───────────────┐││▼▼▼││Account1Account2AccountN│└────────────────────────────────────────┘

Service Control Policies (SCPs)

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "DenyRootUser",
      "Effect": "Deny",
      "Action": "*",
      "Resource": "*",
      "Condition": {
        "StringLike": {
          "aws:PrincipalArn": "arn:aws:iam::*:root"
        }
      }
    }
  ]
}

5. Detection

Detective Controls

ServiceFunction
GuardDutyThreat detection using ML
Security HubAggregated security findings
DetectiveSecurity investigation
InspectorVulnerability assessment
MacieSensitive data discovery
ConfigConfiguration compliance

GuardDuty Findings

FindingTypes:├──EC2Findings│├──UnauthorizedAccess:EC2/SSHBruteForce│└──CryptoCurrency:EC2/BitcoinTool.B├──S3Findings│├──Policy:S3/AccountBlockPublicAccessDisabled│└──Exfiltration:S3/ObjectRead.Unusual└──IAMFindings├──Persistence:IAMUser/AnomalousBehavior└──UnauthorizedAccess:IAMUser/MaliciousIPCaller

Security Hub

┌─────────────────┐│SecurityHub│└────────┬────────┘│┌──────────────┬─────────┼─────────┬──────────────┐│││││▼▼▼▼▼┌─────────┐┌─────────┐┌────────┐┌────────┐┌────────┐│GuardDuty││Inspector││Macie││Config││Firewall││││││││││Manager│└─────────┘└─────────┘└────────┘└────────┘└────────┘Standards:-AWSFoundationalSecurityBestPractices-CISAWSFoundationsBenchmark-PCIDSS

6. Infrastructure Protection

Network Security Layers

┌─────────────────────────────────────────────────────┐│Internet│└───────────────────────┬─────────────────────────────┘│▼┌─────────────────────────────────────────────────────┐│EdgeLayer:CloudFront+WAF+Shield│└───────────────────────┬─────────────────────────────┘│▼┌─────────────────────────────────────────────────────┐│VPCLayer:InternetGateway│└───────────────────────┬─────────────────────────────┘│▼┌─────────────────────────────────────────────────────┐│SubnetLayer:NACL(Stateless)│└───────────────────────┬─────────────────────────────┘│▼┌─────────────────────────────────────────────────────┐│InstanceLayer:SecurityGroups(Stateful)│└─────────────────────────────────────────────────────┘

AWS WAF

WAFRules:├──ManagedRules(AWS,Marketplace)│├──Commonvulnerabilities│├──Knownbadinputs│└──SQLinjection,XSS└──CustomRules├──Ratelimiting├──Geoblocking└──IPwhitelist/blacklist

7. Data Protection

Encryption Strategy

Data StateServiceKey Management
At Rest (S3)SSE-S3, SSE-KMSKMS
At Rest (EBS)EBS EncryptionKMS
At Rest (RDS)RDS EncryptionKMS
In TransitTLS 1.2+ACM

AWS KMS

KeyHierarchy:┌─────────────────────────────────────┐│KMSkey(customermanagedkey)││(keymaterialneverleavesKMS)│└─────────────────┬───────────────────┘││Encrypts▼┌─────────────────────────────────────┐│DataEncryptionKey││(DEK)│└─────────────────┬───────────────────┘││Encrypts▼┌─────────────────────────────────────┐│YourData│└─────────────────────────────────────┘

Secrets Management

  • Secrets Manager: Automatic rotation, database credentials
  • Parameter Store: Configuration, less frequent rotation

8. Incident Response

Response Automation

Detection→Analysis→Containment(GuardDuty)(Detective)(Lambda+SSM)│││└───────────────────────┴────────────────────┘│EventBridgeRules│▼AutomatedResponse-Isolateinstance-Revokecredentials-Captureforensics

Phần 4: Reliability Pillar

1. Định nghĩa Reliability Pillar

Khả năng của workload thực hiện đúng chức năng như expected, và phục hồi nhanh chóng khi có failures.

4 Focus Areas

  1. Foundations
  2. Workload Architecture
  3. Change Management
  4. Failure Management

2. Design Principles

1. Automatically recover from failure

┌─────────────┐HealthCheckFailed┌─────────────┐│Healthy│────────────────────────►│Unhealthy││Instance││Instance│└─────────────┘└──────┬──────┘│▼┌─────────────┐│AutoScale││Replace│└─────────────┘

2. Test recovery procedures

  • Chaos Engineering
  • Game Days
  • Disaster Recovery drills

3. Scale horizontally

VerticalScaling:HorizontalScaling:┌─────────────────┐┌─────┐┌─────┐┌─────┐│││││││││BigServer│vs│Small││Small││Small│││││││││└─────────────────┘└─────┘└─────┘└─────┘SinglepointDistributedoffailureNoSPOF

4. Stop guessing capacity

  • Auto Scaling
  • Serverless architectures
  • On-demand resources

5. Manage change through automation

  • Infrastructure as Code
  • CI/CD pipelines
  • Automated testing

3. Key Concepts: RTO và RPO

Recovery Time Objective (RTO)

Thời gian tối đa acceptable để phục hồi system sau disaster

Recovery Point Objective (RPO)

Lượng data loss tối đa acceptable (tính bằng thời gian)

Disaster│◄───────────────────┼───────────────────►││││RPO│RTO││DataLoss│Downtime││││▼▼▼LastBackupDisasterServiceOccursRestored

RTO/RPO Trade-offs

StrategyRTORPOCost
Backup & RestoreHours (có thể 24h+ tuỳ data size)Hours$
Pilot Light10s of minutesMinutes$$
Warm StandbyMinutesSeconds$$$
Multi-Site ActiveNear zeroNear zero$$$$

4. Disaster Recovery Strategies

1. Backup and Restore

┌─────────────────────────────────────────────────────────┐│PrimaryRegion││┌─────────┐┌─────────┐┌─────────┐│││EC2││RDS││S3│││└────┬────┘└────┬────┘└────┬────┘││││││││Backup│Cross-region││││replication│└───────┼─────────────┼─────────────┼─────────────────────┘│││▼▼▼┌─────────────────────────────────────────────────────────┐│DRRegion││┌─────────────────────────────┐│││AMIs&Snapshots││││S3BackupData│││└─────────────────────────────┘││││[Nothingrunning-lowestcost]│└─────────────────────────────────────────────────────────┘RTO:Hours|RPO:Hours|Cost:$

2. Pilot Light

┌─────────────────────────────────────────────────────────┐│PrimaryRegion││┌─────────┐┌─────────┐┌─────────┐│││Web/App││DB││S3││││(ON)││(ON)│││││└─────────┘└────┬────┘└─────────┘│││││Replication│└─────────────────────┼───────────────────────────────────┘│▼┌─────────────────────────────────────────────────────────┐│DRRegion││┌─────────┐┌─────────┐┌─────────┐│││Web/App││DB││S3││││(OFF)││(ON-││Synced││││││Read)│││││└─────────┘└─────────┘└─────────┘││││[OnlyDBrunning-mediumcost]│└─────────────────────────────────────────────────────────┘RTO:10sminutes|RPO:Minutes|Cost:$$

3. Warm Standby

┌─────────────────────────────────────────────────────────┐│PrimaryRegion││┌─────────┐┌─────────┐┌─────────┐│││Web/App││DB││S3││││(ON)││(ON)││││││FULL││Primary│││││└─────────┘└────┬────┘└─────────┘│││││Replication│└─────────────────────┼───────────────────────────────────┘│▼┌─────────────────────────────────────────────────────────┐│DRRegion││┌─────────┐┌─────────┐┌─────────┐│││Web/App││DB││S3││││(ON)││Standby││Synced││││MINIMAL││(ON)│││││└─────────┘└─────────┘└─────────┘││││[Scaled-downversionrunning]│└─────────────────────────────────────────────────────────┘RTO:Minutes|RPO:Seconds|Cost:$$$

4. Multi-Site Active/Active

┌─────────────────────────────────────────────────────────┐│RegionA││┌─────────┐┌─────────┐┌─────────┐│││Web/App││DB││S3││││(ON)││(ON)│◄─►│Synced││││FULL││Primary│││││└─────────┘└────┬────┘└─────────┘│└─────────────────────┼───────────────────────────────────┘▲│▲│Bi-directional│Route53ReplicationRoute53WeightedWeighted│││▼▼▼┌─────────────────────────────────────────────────────────┐│RegionB││┌─────────┐┌─────────┐┌─────────┐│││Web/App││DB││S3││││(ON)││(ON)│◄─►│Synced││││FULL││Primary│││││└─────────┘└─────────┘└─────────┘│└─────────────────────────────────────────────────────────┘RTO:Nearzero|RPO:Nearzero|Cost:$$$$

5. Fault Tolerance Patterns

Circuit Breaker Pattern

NormalFailuresDetectedRecovery│││▼▼▼┌────────┐┌────────┐┌────────┐│CLOSED│────────────►│OPEN│───────────►│HALF│││threshold││timeout│OPEN││Allow│exceeded│Block││Test││calls││calls││calls│└────────┘└────────┘└───┬────┘│┌─────────────────────────┤││SuccessFailure││▼▼┌────────┐┌────────┐│CLOSED││OPEN│└────────┘└────────┘

Retry with Exponential Backoff

Attempt 1: Wait 1 second
Attempt 2: Wait 2 seconds
Attempt 3: Wait 4 seconds
Attempt 4: Wait 8 seconds
Attempt 5: Wait 16 seconds (+ jitter)

6. AWS Services cho Reliability

High Availability

ServicePurpose
ELBDistribute traffic across AZs
Auto ScalingMaintain desired capacity
RDS Multi-AZDatabase failover
S311 9s durability
Route 53Health checks và failover

Disaster Recovery

ServicePurpose
AWS BackupCentralized backup management
S3 Cross-Region ReplicationData replication
Aurora Global DatabaseMulti-region database
DynamoDB Global TablesMulti-region NoSQL
CloudFormation StackSetsMulti-region deployment

7. Availability Calculations

SLA và Nines

AvailabilityDowntime/YearDowntime/Month
99% (2 nines)3.65 days7.3 hours
99.9% (3 nines)8.76 hours43.8 minutes
99.99% (4 nines)52.6 minutes4.38 minutes
99.999% (5 nines)5.26 minutes26.3 seconds

Calculating Composite Availability

Serial Components (both must work):
A1 = 99.9%, A2 = 99.9%
Total = A1 × A2 = 99.8%

Parallel Components (only one must work):
A1 = 99.9%, A2 = 99.9%
Total = 1 - (1-A1) × (1-A2) = 99.9999%

Câu hỏi ôn tập

  1. Well-Architected Framework có bao nhiêu pillars?

    Xem đáp án

    6 pillars: Operational Excellence, Security, Reliability, Performance Efficiency, Cost Optimization, và Sustainability (thêm năm 2021). Mỗi pillar có design principles, best practices, và questions trong Well-Architected Tool. SAP-C02 hỏi về cả 6 pillars — Sustainability là pillar mới nhất, focus on environmental impact.

  2. Pillar nào được thêm vào năm 2021?

    Xem đáp án

    Sustainability pillar — focus on environmental impacts: minimize energy consumption, increase efficiency, reduce carbon footprint. Gồm các best practices như: chọn Region với renewable energy, right-sizing resources, dùng managed services, serverless để giảm idle capacity, optimize code để giảm CPU/memory usage. Dù ít câu hỏi nhất trong SAP nhưng cần biết principles.

  3. "Stop guessing capacity needs" áp dụng cho pillar nào?

    Xem đáp án

    Đây là một general design principle của toàn Framework, và ở cấp pillar thì thuộc Reliability pillar (theo AWS Well-Architected docs — xem Design Principles của Reliability ở Phần 4 của bài này). Thay vì over-provision "just in case", dùng Auto Scaling và serverless để scale đúng theo demand — không đoán capacity. Khái niệm này có liên quan đến Cost Optimization (không trả cho capacity không dùng) nhưng không phải Performance Efficiency — pillar đó có các principles: democratize advanced technologies, go global in minutes, use serverless architectures, experiment more often, mechanical sympathy.

  4. Well-Architected Tool được sử dụng để làm gì?

    Xem đáp án

    Evaluate workloads theo AWS best practices qua questionnaire (~60+ câu hỏi theo pillar). Tool generate report với: HRI (High Risk Items), MRI (Medium Risk Items), improvement plan với actions cụ thể. Có thể lưu milestones (trước/sau improvements), share với AWS Solutions Architects cho review, và tích hợp với Trusted Advisor. Miễn phí trong AWS Console.

  5. Kể tên 3 specialized lenses.

    Xem đáp án

    Có nhiều lenses, ví dụ phổ biến: Serverless Application Lens (Lambda, API GW, DynamoDB patterns), Machine Learning Lens (ML workload best practices), SaaS Lens (multi-tenant architectures), IoT Lens, HPC Lens, Data Analytics Lens, Financial Services Lens. Lenses bổ sung additional best practices cho specific domains trên foundation của 6 core pillars.

  6. "Perform operations as code" nghĩa là gì?

    Xem đáp án

    Toàn bộ infrastructure và operations được define dưới dạng code (Infrastructure as Code): CloudFormation, CDK, Terraform. Operations tasks như patching, scaling, incident response cũng code hóa qua SSM Automation, Lambda, EventBridge rules. Lợi ích: reproducible, version-controlled, testable, auditable, peer-reviewable. Loại bỏ manual operations prone to human error.

  7. Sự khác biệt giữa Runbook và Playbook?

    Xem đáp án

    Runbook: tài liệu hướng dẫn step-by-step cho một routine operational task cụ thể (restart service, disk cleanup, backup verify). Playbook: tài liệu hướng dẫn incident response — khi sự cố xảy ra (production down, security breach), playbook guide investigation và remediation. Runbook cho proactive/planned; Playbook cho reactive/unplanned. Cả hai nên được automated khi có thể (SSM Automation).

  8. Blue/Green deployment có ưu điểm gì?

    Xem đáp án

    (1) Zero-downtime deployment — swap traffic từ Blue (current) sang Green (new) ngay lập tức, (2) Instant rollback — nếu Green có vấn đề, switch traffic về Blue trong giây, (3) Testing Green với real traffic (small %) trước khi full cutover, (4) Production validation mà không affect users. AWS support: ALB listener rules, Route 53 weighted routing, CodeDeploy Blue/Green, Elastic Beanstalk. Chi phí: cần double resources trong thời gian deployment.

  9. AWS service nào dùng cho distributed tracing?

    Xem đáp án

    AWS X-Ray — instrument applications để trace requests across microservices, Lambda, API GW, DynamoDB. X-Ray SDK generates trace IDs, segments, subsegments. Service Map visualize dependencies và bottlenecks. Cold start detection, latency percentiles, error rates per service. Kết hợp với CloudWatch Container Insights cho ECS/EKS observability. CloudWatch Application Insights cũng tự động detect anomalies.

  10. Game Days được dùng để làm gì?

Xem đáp án

Chaos engineering / disaster simulations trong controlled environment. Team simulate failures (AZ outage, database fail, network partition, high CPU) để test: (1) Recovery procedures và runbooks hoạt động đúng không, (2) Monitoring và alerts fire đúng, (3) Team response time và coordination, (4) Infrastructure actually recovers như designed. Kết quả: identify gaps trước khi production incident thực sự xảy ra. AWS Fault Injection Service (FIS) tool cho Game Days.

  1. Shared Responsibility Model: AWS chịu trách nhiệm gì?
Xem đáp án

AWS chịu trách nhiệm "Security OF the cloud": physical security của data centers, hardware, network infrastructure, hypervisor/host OS, managed service software. Khách hàng chịu trách nhiệm "Security IN the cloud": OS (patch, update), applications, data (encryption, access), network configuration (SG, NACL), IAM (users, roles, policies). Shared model thay đổi theo service type: IaaS (EC2) → khách hàng nhiều hơn; SaaS/Managed (RDS, Lambda) → AWS nhiều hơn.

  1. GuardDuty khác Security Hub như thế nào?
Xem đáp án

GuardDuty: threat detection service — phân tích VPC Flow Logs, DNS, CloudTrail để tìm anomalies và known threats (compromised credentials, coin mining, port scanning). Tự generate findings. Security Hub: aggregation và compliance service — thu thập findings từ GuardDuty, Inspector, Macie, Config, IAM Access Analyzer, và third-party tools vào một dashboard. GuardDuty detects threats; Security Hub consolidates và prioritizes across services.

  1. Tại sao nên dùng IAM Identity Center thay vì IAM users?
Xem đáp án

IAM Identity Center (SSO) cho: (1) Centralized access nhiều AWS accounts từ 1 portal — không cần riêng IAM users per account, (2) Integration với existing IdP (Active Directory, Okta, Azure AD) — dùng corporate credentials, (3) Consistent MFA và access policies across organization, (4) Temporary credentials tự động — không cần manage long-term access keys, (5) Audit trail centralized. IAM users per account = messy với 100+ accounts.

  1. WAF có thể block những loại attacks nào?
Xem đáp án

WAF block Layer 7 attacks: SQL injection, XSS (Cross-Site Scripting), CSRF, HTTP flood, bad bots, request smuggling. Dùng managed rule groups (AWS hay third-party) hoặc custom rules. Rate-based rules block volumetric Layer 7 DDoS. Geo-blocking theo country. IP reputation lists. WAF không protect Layer 3/4 (volumetric DDoS) — cần Shield cho đó. WAF deploy trên CloudFront, ALB, API GW, AppSync, Cognito.

  1. Secrets Manager khác Parameter Store như thế nào?
Xem đáp án

Secrets Manager: tự động rotation của secrets (built-in support cho RDS, Redshift, DocumentDB, custom Lambda rotator), chi phí $0.40/secret/month. Parameter Store: không có built-in auto-rotation, free (Standard tier), simple key-value. Dùng Secrets Manager cho database credentials cần rotation; Parameter Store cho application config, feature flags, non-rotating secrets. Lambda và ECS tích hợp tốt với cả hai.

  1. Sự khác biệt giữa RTO và RPO?
Xem đáp án

RTO (Recovery Time Objective): thời gian tối đa được phép từ khi disaster xảy ra đến khi service hoạt động trở lại — "maximum acceptable downtime". RPO (Recovery Point Objective): lượng data mất tối đa có thể chấp nhận — "maximum acceptable data loss". Ví dụ: RTO 1 giờ = phải back online trong 1 giờ; RPO 15 phút = backup mỗi 15 phút, chấp nhận mất tối đa 15 phút data. RTO thấp hơn = đắt hơn (Warm Standby/Active-Active); RPO thấp hơn = sync replication đắt hơn.

  1. 4 DR strategies là gì và xếp theo cost từ thấp đến cao?
Xem đáp án

Từ rẻ nhất → đắt nhất: (1) Backup & Restore — backup sang S3/Glacier, restore khi cần, RTO giờ-ngày, (2) Pilot Light — core DB running, compute off, RTO phút-giờ, (3) Warm Standby — scaled-down production running, RTO phút, (4) Multi-Site Active-Active — full production cả hai regions, RTO ~0. Tương quan: cost thấp hơn = RTO/RPO cao hơn.

  1. Pilot Light khác Warm Standby như thế nào?
Xem đáp án

Pilot Light: chỉ core components running ở DR region — thường chỉ database replication (RDS cross-region replica, DynamoDB Global Tables). Compute (EC2, ECS) tắt — cần launch/scale khi failover. Warm Standby: scaled-down production running — cả compute lẫn database, nhưng với ít capacity hơn (ví dụ 10% production scale). Warm Standby failover nhanh hơn (chỉ scale up), Pilot Light rẻ hơn (không pay for idle compute).

  1. Circuit Breaker pattern giải quyết vấn đề gì?
Xem đáp án

Ngăn cascading failures trong microservices. Khi service A liên tục fail khi gọi service B (đang chậm/down), Circuit Breaker "mở" — không gọi B nữa và trả fallback response ngay. Sau timeout, thử "half-open" — một số requests đến B. Nếu succeed → "đóng" lại bình thường; nếu vẫn fail → "mở" tiếp. AWS App Mesh, Resilience4j, AWS SDK retry mechanisms implement circuit breaker. Ngăn B's slowness làm A cũng chậm và exhaustion thread pool.

  1. Cách tính availability của 2 components chạy song song?
Xem đáp án

Parallel (redundant) components: Availability = 1 - (1-A1) × (1-A2). Ví dụ: 2 EC2 instances mỗi cái 99% available → 1 - (1-0.99)² = 1 - 0.0001 = 99.99%. Series components: A_total = A1 × A2 (mỗi component phải hoạt động). Đây là lý do Multi-AZ tăng availability: failure cả 2 AZs cùng lúc xác suất rất thấp. Thêm AZ → availability tăng gần đến 100%.

Bài tập thực hành

Phần 1: AWS Well-Architected Framework Overview

  • Truy cập Well-Architected Tool trong AWS Console
  • Đọc Well-Architected Framework Whitepaper
  • Xem qua một Lens (ví dụ: Serverless Lens)

Phần 2: Operational Excellence Pillar

  • Tạo CloudFormation stack đơn giản
  • Setup CloudWatch Dashboard
  • Tạo CloudWatch Alarm cho EC2 CPU
  • Explore AWS Systems Manager features

Phần 3: Security Pillar

  • Enable GuardDuty trong account
  • Setup Security Hub
  • Tạo KMS key và encrypt S3 bucket
  • Configure WAF với managed rules

Phần 4: Reliability Pillar

  • Setup RDS Multi-AZ
  • Configure S3 Cross-Region Replication
  • Tạo Auto Scaling Group với health checks
  • Test failover scenarios

Tài liệu tham khảo


Bài tiếp theo →