AWS Well-Architected Framework – Design Principles

Summary

Dựa vào AWS Well-Architected Framework – Six Pillars - 6 trụ cột cho 1 well-architected framework, thì người ta đưa ra 1 số principles khi design hệ thống.

Notes

1. Scalability

Một hệ thống tốt cần phải scale được khi cần thiết. Có 2 cách scale:

  • Scaling Horizontally – Tăng số lượng resources
  • Scaling Vertically –  Tăng spec của 1 resource

3. Reliability

2. Disposable Resources Instead of Fixed Servers

  • Instantiating Compute Resources – Tự động tạo/add thêm resources dựa vào các config trước đó.
  • Infrastructure as Code – Dùng code để khiến cho infrastructure reusable, maintainable, extensible, and testable.

1. Operational Excellence

3. Automation

  • Serverless Management and Deployment – Sử dụng serverless để focus vào application code. AWS lo phần còn lại
  • Infrastructure Management and Deployment – AWS lo resource provisioning, load balancing, auto scaling, and monitoring.
  • Alarms and Events 

1. Operational Excellence

4. Loose Coupling

  • Well-Defined Interfaces - Giảm sự phụ thuộc của 1 hệ thống bằng cách sử dụng các components, sau đó cho nó giao tiếp với nhau qua các interface bằng RESTful APIs.
  • Service Discovery
  • Asynchronous Integration

6. Sustainability - Bền vững

5. Services, Not Servers

  • Managed Services - Cung cấp đầy đủ các services của 1 applications: DB, ML, queuing, search, email, notifications, …
  • Serverless Architectures - Build app mà không cần phải quản lý server infrastructure.

6. Databases

Chọn DB phù hợp cho từng dự án:

  • Relational Database
  • NoSQL DB
  • Data Warehouses
  • Graph Databases

7. Managing Increasing Volumes of Data

  • Data Lake

8. Removing Single Points of Failure

  • Introducing Redundancy:
    • Standby redundancy - Khi 1 resource fails, ta phải chạy 1 resource khác để thay thế. Trong quá trình đó, resource status sẽ là unavailable. (Thường dùng cho stateful component như Relation Databases).
    • Active redundancy - Khi 1 thằng fail, những thằng còn lại sẽ giúp gánh đỡ tải.
  • Detect Failure – use health checks and collect logs
  • Durable Data Storage:
    • Synchronous replication: Lưu trữ data ở cả trên primary + replicas.
    • Asynchronous replication: Đồng bộ ngầm. Thay đổi trên primary không được sync luôn sang bên replicas.
    • Quorum-based replication: Trộn 2 loại trên, ta cần chỉ định số lượng tối thiểu các nodes phải tham gia vào quá trình write.
  • Automated Multi-Data Center Resilience
  • Fault Isolation and Traditional Horizontal Scaling – Shuffle Sharding

3. Reliability

9. Optimize for Cost

  • Right Sizing: Dùng size vừa đủ.
  • Elasticity
  • Take Advantage of the Variety of Purchasing Options – Reserved Instances vs Spot Instances.

5. Cost Optimization

10. Caching

  • Application Data Caching – store and retrieve information from fast, managed, in-memory caches.
  • Edge Caching – serve content by infrastructure that is closer to viewers, which lowers latency and gives high, sustained data transfer rates necessary to deliver large popular objects to end users at scale.

11. Security

  • Use AWS Features for Defense in Depth - Sử dụng services của AWS để bảo vệ infra từ tầng network application and DB.
  • Share Security Responsibility with AWS – AWS handles security OF the Cloud while customers handle security IN the Cloud.
  • Reduce Privileged Access – implement Principle of Least Privilege controls.
  • Security as Code – firewall rules, network access controls, internal/external subnets, and operating system hardening can all be  captured in a template that defines a Golden Environment.
  • Real-Time Auditing – implement continuous monitoring and automation of controls on AWS to minimize exposure to security risks.

12. Cloud Architecture Best Practices

  1. Decouple your components: Sử dụng các components và hạn chế phụ thuộc vào nhau. Để nếu 1 thằng fail thì những thằng còn lại cũng sẽ vẫn hoạt động tốt.
  2. Think parallel
  3. Implement elasticity
  4. Design for failure

Questions