Ngân hàng đề — AWS Certified Database Specialty

Tìm thấy 358 câu.

Câu 181
A financial services company has an application deployed on AWS that uses an Amazon Aurora PostgreSQL DB cluster. A recent audit showed that no log files contained database administrator activity. A database specialist needs to recommend a solution to provide database access and activity logs. The solution should use the least amount of effort and have a minimal impact on performance.
Which solution should the database specialist recommend?
  1. A Enable Aurora Database Activity Streams on the database in synchronous mode. Connect the Amazon Kinesis data stream to Kinesis Data Firehose. Set the Kinesis Data Firehose destination to an Amazon S3 bucket.
  2. B Create an AWS CloudTrail trail in the Region where the database runs. Associate the database activity logs with the trail.
  3. C Enable Aurora Database Activity Streams on the database in asynchronous mode. Connect the Amazon Kinesis data stream to Kinesis Data Firehose. Set the Firehose destination to an Amazon S3 bucket.
  4. D Allow connections to the DB cluster through a bastion host only. Restrict database access to the bastion host and application servers. Push the bastion host logs to Amazon CloudWatch Logs using the CloudWatch Logs agent.
Xem giải thích

🧩 Phân tích chi tiết câu hỏi

📖 Nội dung câu hỏi:
Câu hỏi xoay quanh một công ty dịch vụ tài chính đang chạy ứng dụng trên AWS sử dụng Amazon Aurora PostgreSQL DB cluster. Kết quả kiểm toán gần đây cho thấy không có file log nào ghi nhận hoạt động của database administrator (DBA). Chuyên gia cơ sở dữ liệu (database specialist) cần đề xuất giải pháp để cung cấp log truy cập và hoạt động cơ sở dữ liệu (database access và activity logs). Giải pháp phải đáp ứng hai tiêu chí chính:

  • Ít công sức triển khai nhất (least amount of effort).
  • Tác động tối thiểu đến hiệu suất (minimal impact on performance).

🛠️ Bối cảnh kỹ thuật: Aurora PostgreSQL hỗ trợ các tính năng logging nâng cao như Aurora Database Activity Streams (DAS) để capture chi tiết hoạt động DBA (như DDL/DML queries, connections). Đây là giải pháp native của AWS, dễ tích hợp với Kinesis và S3 để lưu trữ lâu dài. Câu hỏi nhấn mạnh nhu cầu log hoạt động DBA (không chỉ general logs), nên cần tính năng chuyên biệt thay vì CloudTrail hay bastion host.

✅ Đáp án đúng:
Enable Aurora Database Activity Streams on the database in asynchronous mode. Connect the Amazon Kinesis data stream to Kinesis Data Firehose. Set the Firehose destination to an Amazon S3 bucket.

Lý do chọn đáp án này (theo kiến thức AWS cập nhật 2026):

  • Aurora DAS là tính năng chính thức của Aurora PostgreSQL (từ version 11+), capture toàn bộ hoạt động DBA (queries, connections, changes) ở dạng PostgreSQL logical replication stream.
  • Asynchronous mode giảm thiểu tác động performance (minimal CPU/IO overhead ~1-2%, không block operations), phù hợp yêu cầu "minimal impact". Synchronous mode sẽ cao hơn (real-time nhưng tốn tài nguyên hơn).
  • Least effort: Chỉ enable qua AWS Console/CLI/API, tự động stream qua Kinesis → Firehose → S3 (batching/compression tự động, không code custom).
  • Hoàn hảo cho compliance/audit tài chính.
    📘 Tài liệu tham khảo: AWS Documentation - Aurora Database Activity Streams (cập nhật 2024-2026, hỗ trợ PostgreSQL 15+ với enhanced security).

🔍 Phân tích tất cả các phương án

🗂️ Phương án A (SAI):
Enable Aurora Database Activity Streams on the database in synchronous mode. Connect the Amazon Kinesis data stream to Kinesis Data Firehose. Set the Kinesis Data Firehose destination to an Amazon S3 bucket.
❌ Tại sao sai: Synchronous mode capture real-time nhưng tăng overhead performance đáng kể (có thể lên 10-20% CPU/latency trên high-load workloads), vi phạm "minimal impact on performance". Effort tương đương async nhưng không tối ưu. AWS recommend async cho hầu hết cases.

🗂️ Phương án B (SAI):
Create an AWS CloudTrail trail in the Region where the database runs. Associate the database activity logs with the trail.
❌ Tại sao sai: CloudTrail chỉ log AWS API calls (management events như CreateDBInstance), không capture DB-level activity (queries, DBA actions inside DB). Không có integration native với Aurora PostgreSQL activity logs. Effort cao hơn (cần config trail + filters), và không giải quyết vấn đề audit DBA queries.

🗂️ Phương án C (ĐÚNG):
Enable Aurora Database Activity Streams on the database in asynchronous mode. Connect the Amazon Kinesis data stream to Kinesis Data Firehose. Set the Firehose destination to an Amazon S3 bucket.
✅ Xác nhận đúng: Như giải thích ở trên – native, low-effort, minimal impact, full DBA activity capture. Stream → Firehose → S3 đảm bảo durability/scalability (S3 partitioning tự động cho queries analysis).

🗂️ Phương án D (SAI):
Allow connections to the DB cluster through a bastion host only. Restrict database access to the bastion host and application servers. Push the bastion host logs to Amazon CloudWatch Logs using the CloudWatch Logs agent.
❌ Tại sao sai: Bastion host chỉ log network connections/OS-level (SSH/VPC access), không capture DB activity/queries bên trong Aurora. Effort cao (setup bastion, IAM, CloudWatch agent, security groups), performance impact gián tiếp (latency qua proxy), và không toàn diện cho audit DBA. Không phải giải pháp native cho Aurora.

💡 Kết luận: Giải pháp DAS asynchronous là best practice cho Aurora PostgreSQL audit (theo AWS Well-Architected Framework - Reliability & Security pillars). Nếu triển khai, enable qua ModifyDBCluster API với server_audit_logging_enabled và DAS params! 🚀

Câu 182
A company uses a single-node Amazon RDS for MySQL DB instance for its production database. The DB instance runs in an AWS Region in the United States.
A week before a big sales event, a new maintenance update is available for the DB instance. The maintenance update is marked as required. The company wants to minimize downtime for the DB instance and asks a database specialist to make the DB instance highly available until the sales event ends.
Which solution will meet these requirements?
  1. A Defer the maintenance update until the sales event is over.
  2. B Create a read replica with the latest update. Initiate a failover before the sales event.
  3. C Create a read replica with the latest update. Transfer all read-only traffic to the read replica during the sales event.
  4. D Convert the DB instance into a Multi-AZ deployment. Apply the maintenance update.
Xem giải thích

🧩 Phân tích chi tiết nội dung câu hỏi

Câu hỏi mô tả tình huống một công ty đang sử dụng Amazon RDS for MySQL DB instance kiểu single-node (chỉ một nút chính, không có tính sẵn sàng cao - HA) ở một Region tại Mỹ làm cơ sở dữ liệu sản xuất. Một tuần trước sự kiện bán hàng lớn, có bản maintenance update bắt buộc (required) dành cho DB instance này. Công ty muốn giảm thiểu thời gian downtime (thời gian gián đoạn dịch vụ) và làm cho DB instance có tính sẵn sàng cao (highly available) cho đến khi sự kiện kết thúc.
📌 Yêu cầu chính: Giải pháp phải đảm bảo HA ngay lập tức, minimize downtime khi apply update bắt buộc, và phù hợp với RDS MySQL (dựa trên phiên bản AWS mới nhất đến 2026, hỗ trợ Multi-AZ với failover tự động <60 giây).
🛠️ Bối cảnh AWS: Maintenance update "required" không thể hoãn (defer) vô thời hạn, phải apply trong maintenance window. Single-node dễ downtime nếu lỗi hoặc maintenance (~ vài phút đến giờ). Multi-AZ cung cấp standby replica tự động failover.

✅ Đáp án đúng và lý do lựa chọn

Đáp án đúng: Convert the DB instance into a Multi-AZ deployment. Apply the maintenance update.
🧩 Lý do chi tiết:

  • Chuyển sang Multi-AZ tạo ngay standby replica ở Availability Zone (AZ) khác, đảm bảo HA (failover tự động nếu primary fail, RTO ~60 giây).
  • Apply maintenance update trên Multi-AZ: RDS sẽ failover tự động sang standby (không downtime lớn), sau đó update primary cũ thành standby mới. Downtime tối thiểu (~1-2 phút), phù hợp minimize downtime.
  • Giải pháp này vĩnh viễn HA đến sau sự kiện, không cần thay đổi thêm. Hoàn hảo cho production trước event lớn.
    📘 Tài liệu tham khảo:
  • AWS RDS Multi-AZ Deployment (cập nhật 2024-2026: Hỗ trợ MySQL 8.x với auto-failover).
  • RDS Maintenance & Updates (Required updates bắt buộc apply, Multi-AZ giảm downtime 90%).

❌ Phân tích tất cả các phương án (đúng/sai)

Dưới đây là phân tích từng lựa chọn, giữ nguyên văn bản gốc tiếng Anh. Mỗi phương án được đánh giá dựa trên tính khả thi, downtime, và HA theo best practices AWS RDS.

  • Deffer the maintenance update until the sales event is over.
    ❌ Sai vì: Update được đánh dấu "required" (bắt buộc) không thể defer vô thời hạn. AWS chỉ cho phép defer minor updates không required; required phải apply trong maintenance window (thường 1-35 ngày). Giải pháp này không làm HA (vẫn single-node), rủi ro cao nếu lỗi xảy ra trước event. Downtime sau event vẫn lớn (~15-30 phút).

  • Create a read replica with the latest update. Initiate a failover before the sales event.
    ❌ Sai vì: Read replica chỉ hỗ trợ read traffic, không tự động failover cho write traffic (cần manual promote, có replication lag ~giây-phút). Không thể "initiate failover" trực tiếp từ read replica cho production writes mà không downtime lớn (promote mất 1-5 phút + lag recovery). Không đảm bảo HA thực sự cho writes, và primary vẫn single-node dễ fail.

  • Create a read replica with the latest update. Transfer all read-only traffic to the read replica during the sales event.
    ❌ Sai vì: Chỉ chuyển read-only traffic sang replica, nhưng write traffic vẫn trên primary single-node → không HA cho writes (rủi ro cao trong sales event). Update trên replica không giúp primary; primary vẫn cần apply required update riêng, gây downtime. Giải pháp tạm thời, không toàn diện, không minimize downtime cho toàn bộ workload.

  • Convert the DB instance into a Multi-AZ deployment. Apply the maintenance update.
    ✅ Đúng vì: Như giải thích trên, tạo HA ngay lập tức với standby AZ khác, apply update qua failover tự động (downtime <2 phút). Hoàn thành trong 1 tuần trước event, chi phí thấp (Multi-AZ chỉ +50% phí), và giữ nguyên MySQL compatibility. Best practice cho production!
    🛠️ Lưu ý thực hiện: Sử dụng AWS Console/CLI: Modify DB → Enable Multi-AZ → Schedule maintenance. Failover test trước event để verify.

Câu 183
A company is migrating a database in an Amazon RDS for SQL Server DB instance from one AWS Region to another. The company wants to minimize database downtime during the migration.
Which strategy should the company choose for this cross-Region migration?
  1. A Back up the source database using native backup to an Amazon S3 bucket in the same Region. Then restore the backup in the target Region.
  2. B Back up the source database using native backup to an Amazon S3 bucket in the same Region. Use Amazon S3 Cross-Region Replication to copy the backup to an S3 bucket in the target Region. Then restore the backup in the target Region.
  3. C Configure AWS Database Migration Service (AWS DMS) to replicate data between the source and the target databases. Once the replication is in sync, terminate the DMS task.
  4. D Add an RDS for SQL Server cross-Region read replica in the target Region. Once the replication is in sync, promote the read replica to master.
Xem giải thích

🧩 Phân tích nội dung câu hỏi

Câu hỏi tập trung vào việc di chuyển (migrate) một cơ sở dữ liệu (database) RDS for SQL Server từ một AWS Region sang Region khác, với yêu cầu tối thiểu hóa thời gian ngừng hoạt động (downtime) của database.

📘 Chi tiết vấn đề:

  • RDS for SQL Server là dịch vụ quản lý database SQL Server trên AWS.
  • Cross-Region migration nghĩa là di chuyển giữa các Region khác nhau (ví dụ: us-east-1 sang eu-west-1).
  • Mục tiêu chính là giảm thiểu downtime, tức là thời gian ứng dụng không thể truy cập database phải ngắn nhất có thể (lý tưởng là gần zero-downtime).
  • Các chiến lược cần đánh giá dựa trên tính năng AWS mới nhất (tính đến 2026): RDS hỗ trợ cross-Region read replicas cho SQL Server, cho phép replication asynchronous liên tục giữa các Region, giúp sync dữ liệu realtime và promote nhanh chóng.

🛠️ Bối cảnh kỹ thuật: Migration cross-Region thường gặp vấn đề về độ trễ mạng, kích thước dữ liệu lớn, và cần đảm bảo tính nhất quán (consistency). Phương pháp tốt nhất phải hỗ trợ ongoing replication thay vì backup/restore thủ công để tránh downtime dài.

✅ Đáp án đúng và lý do lựa chọn

Đáp án đúng: Add an RDS for SQL Server cross-Region read replica in the target Region. Once the replication is in sync, promote the read replica to master.

Lý do chọn đáp án này 🏆:

  • RDS for SQL Server hỗ trợ cross-Region read replicas (tính năng ổn định từ 2019 và cập nhật liên tục đến 2026), cho phép tạo read replica ở Region đích từ source DB.
  • Quá trình replication asynchronous diễn ra liên tục, giữ dữ liệu sync gần realtime (lag thấp, thường <1 phút).
  • Khi sync hoàn tất, promote read replica thành standalone/master chỉ mất vài phút downtime (thường <5 phút), cập nhật DNS endpoint và chuyển traffic ngay lập tức.
  • Đây là chiến lược zero-to-low downtime chính thức được AWS khuyến nghị cho cross-Region migration của RDS SQL Server, tránh mất dữ liệu và dễ rollback nếu cần.

📋 Giải thích tất cả các phương án

Dưới đây là phân tích chi tiết từng lựa chọn, với đánh giá đúng/sai dựa trên hiệu quả minimize downtime và tính khả thi cho RDS SQL Server cross-Region:

  • ❌ Back up the source database using native backup to an Amazon S3 bucket in the same Region. Then restore the backup in the target Region.
    Sai vì: Phương pháp native backup (sử dụng T-SQL BACKUP) tạo full backup lớn, downtime rất cao (giờ đến ngày tùy kích thước DB). Phải dừng write operations để backup consistent, copy manual sang Region đích qua S3, rồi restore tạo DB mới. Không hỗ trợ incremental/ongoing sync, dẫn đến data loss sau backup. AWS không khuyến nghị cho migration low-downtime.

  • ❌ Back up the source database using native backup to an Amazon S3 bucket in the same Region. Use Amazon S3 Cross-Region Replication to copy the backup to an S3 bucket in the target Region. Then restore the backup in the target Region.
    Sai vì: Cải thiện copy tự động nhờ S3 CRR (tính năng nhanh, low-cost), nhưng vẫn dựa trên full backup → downtime lớn tương tự lựa chọn 1 (phải dừng app để backup, restore mất thời gian dài). Không replicate changes sau backup, dễ data loss. Phù hợp cho disaster recovery hơn là live migration.

  • ❌ Configure AWS Database Migration Service (AWS DMS) to replicate data between the source and the target databases. Once the replication is in sync, terminate the DMS task.
    Sai vì: DMS hỗ trợ SQL Server homogeneous migration (source/target cùng engine), với CDC (Change Data Capture) cho ongoing replication. Tuy nhiên, downtime cao hơn (full load + apply changes mất giờ/ngày, lag có thể >1 giờ cross-Region), và terminate task yêu cầu cutover thủ công (dừng writes source, sync final, switch app → downtime 15-60 phút+). DMS phức tạp setup (endpoints, tasks, homog schema), không phải lựa chọn tối ưu cho RDS SQL Server (read replica đơn giản hơn).

  • ✅ Add an RDS for SQL Server cross-Region read replica in the target Region. Once the replication is in sync, promote the read replica to master.
    Đúng vì: Như giải thích ở phần đáp án đúng. Tính năng native RDS, low-overhead, promote nhanh (automatic failover-like), hỗ trợ Multi-AZ ở target sau promote. Đảm bảo RPO gần 0 (ít data loss).

📚 Tài liệu tham khảo (AWS cập nhật 2026)

Hy vọng phân tích này giúp bạn ôn thi hiệu quả! 🚀 Nếu cần thêm ví dụ code hoặc lab, hãy hỏi nhé!

Câu 184
A financial company is hosting its web application on AWS. The application's database is hosted on Amazon RDS for MySQL with automated backups enabled.
The application has caused a logical corruption of the database, which is causing the application to become unresponsive. The specific time of the corruption has been identified, and it was within the backup retention period.
How should a database specialist recover the database to the most recent point before corruption?
  1. A Use the point-in-time restore capability to restore the DB instance to the specified time. No changes to the application connection string are required.
  2. B Use the point-in-time restore capability to restore the DB instance to the specified time. Change the application connection string to the new, restored DB instance.
  3. C Restore using the latest automated backup. Change the application connection string to the new, restored DB instance.
  4. D Restore using the appropriate automated backup. No changes to the application connection string are required.
Xem giải thích

🧩 Phân tích chi tiết nội dung câu hỏi

Câu hỏi xoay quanh tình huống một công ty tài chính đang chạy ứng dụng web trên AWS, với cơ sở dữ liệu (DB) trên Amazon RDS for MySQL có kích hoạt automated backups. Ứng dụng gặp lỗi logical corruption (hỏng logic dữ liệu), khiến DB không phản hồi. Thời điểm corruption chính xác đã được xác định và nằm trong khoảng retention period của backup (thường mặc định 7 ngày, có thể lên đến 35 ngày).

Mục tiêu chính: Khôi phục DB đến điểm thời gian gần nhất trước corruption một cách chính xác nhất. 🛠️

  • RDS hỗ trợ Point-in-Time Recovery (PITR) cho MySQL, sử dụng automated backups kết hợp binary logs để khôi phục đến giây cụ thể (granularity 5 phút).
  • Đây là phương pháp lý tưởng vì corruption là logical (không phải physical), và thời điểm đã biết rõ.
  • Lưu ý: PITR tạo DB instance MỚI, không ghi đè instance gốc, nên ứng dụng cần cập nhật connection string để kết nối instance mới.

✅ Đáp án đúng và lý do lựa chọn

Đáp án đúng: Use the point-in-time restore capability to restore the DB instance to the specified time. Change the application connection string to the new, restored DB instance.

Lý do:

  • PITR là cách chính xác nhất để khôi phục đến thời điểm cụ thể trước corruption, tận dụng automated backups + transaction logs (binary logs). ✅
  • Quy trình tạo DB instance mới (không ảnh hưởng instance gốc), nên bắt buộc phải thay đổi connection string của ứng dụng để trỏ đến endpoint của instance mới.
  • Điều này đảm bảo ứng dụng nhanh chóng hoạt động trở lại với dữ liệu sạch, giảm thiểu downtime. Theo best practices AWS (cập nhật đến 2026), PITR vẫn là tính năng core cho RDS MySQL với hỗ trợ Multi-AZ và encryption. 🛡️

📋 Giải thích tất cả các phương án (đúng/sai)

Dưới đây là phân tích từng lựa chọn, giữ nguyên văn bản gốc bằng tiếng Anh. Mỗi phương án được đánh giá với lý do cụ thể dựa trên tài liệu AWS mới nhất:

  • [SAI] Use the point-in-time restore capability to restore the DB instance to the specified time. No changes to the application connection string are required.
    ❌ Sai vì: PITR luôn tạo DB instance mới với endpoint riêng biệt (không ghi đè instance gốc). Nếu không thay đổi connection string, ứng dụng vẫn kết nối instance cũ bị corrupt, dẫn đến thất bại. Phương án này nhầm lẫn cơ chế PITR cơ bản.

  • [ĐÚNG] Use the point-in-time restore capability to restore the DB instance to the specified time. Change the application connection string to the new, restored DB instance.
    ✅ Đúng vì: Như giải thích ở trên, PITR khôi phục chính xác đến thời điểm chỉ định, và việc cập nhật connection string là bước bắt buộc để ứng dụng sử dụng instance mới. Đây là quy trình chuẩn AWS.

  • [SAI] Restore using the latest automated backup. Change the application connection string to the new, restored DB instance.
    ❌ Sai vì: "Latest automated backup" có thể bao gồm dữ liệu sau corruption (backup hàng ngày), không đảm bảo khôi phục đến "most recent point before corruption". PITR mới chính xác hơn nhờ binary logs. Dù có thay đổi connection string đúng, nhưng không đạt độ chính xác yêu cầu.

  • [SAI] Restore using the appropriate automated backup. No changes to the application connection string are required.
    ❌ Sai kép: (1) Restore từ snapshot backup chỉ khôi phục đến thời điểm backup gần nhất, không chính xác bằng PITR (có thể mất dữ liệu vài giờ). (2) Tạo instance mới nên phải thay đổi connection string. Phương án này không tối ưu và có rủi ro cao.

📘 Tài liệu tham khảo (cập nhật AWS 2026)

Hy vọng phân tích này giúp bạn ôn thi hiệu quả! Nếu cần demo lệnh AWS CLI cho PITR, hãy hỏi thêm nhé. 🚀

Câu 185
A database specialist is designing an application to answer one-time queries. The application will query complex customer data and provide reports to end users.
These reports can include many fields. The database specialist wants to give users the ability to query the database by using any of the provided fields.
The database's traffic volume will be high but variable during peak times. However, the database will not have much traffic at other times during the day.
Which solution will meet these requirements MOST cost-effectively?
  1. A Amazon DynamoDB with provisioned capacity mode and auto scaling
  2. B Amazon DynamoDB with on-demand capacity mode
  3. C Amazon Aurora with auto scaling enabled
  4. D Amazon Aurora in a serverless mode
Xem giải thích

🧩 Phân tích nội dung câu hỏi

Câu hỏi mô tả một chuyên gia cơ sở dữ liệu (database specialist) đang thiết kế ứng dụng để xử lý các truy vấn một lần (one-time queries) trên dữ liệu khách hàng phức tạp, tạo báo cáo với nhiều trường dữ liệu (fields). Người dùng cuối cần truy vấn linh hoạt bằng bất kỳ trường dữ liệu nào được cung cấp. Lưu lượng truy cập (traffic) cao và biến động mạnh vào giờ cao điểm (peak times), nhưng thấp hoặc gần như không có vào các thời điểm khác trong ngày. Yêu cầu là giải pháp tiết kiệm chi phí nhất (MOST cost-effectively), phù hợp với kiến thức AWS cập nhật đến năm 2026 (Aurora Serverless v2 hỗ trợ scale từ 0.5 ACU đến hơn 128 ACU, tự động tạm dừng khi idle).

🛠️ Mục tiêu chính: Cần cơ sở dữ liệu hỗ trợ truy vấn SQL phức tạp/ad-hoc (bất kỳ trường nào), scale tự động theo traffic biến động, và chỉ trả phí khi sử dụng để tối ưu chi phí.

✅ Đáp án đúng: Amazon Aurora in a serverless mode

Lý do lựa chọn:
Aurora Serverless v2 (phiên bản mới nhất đến 2026) là giải pháp serverless hoàn toàn, tự động scale compute (ACU - Aurora Capacity Units) từ 0.5 đến 128+ ACU chỉ trong vài giây, tự động tạm dừng (pause) khi không có traffic để tiết kiệm 100% chi phí compute/storage khi idle. Hoàn hảo cho workload one-time queries, traffic spiky/variable, hỗ trợ SQL chuẩn cho truy vấn phức tạp trên nhiều fields. Không cần quản lý instance, chi phí chỉ tính theo usage thực tế (pay-per-second). Đây là lựa cost-effective nhất so với các option provisioned/on-demand khác.

📘 Tài liệu tham khảo:

❌ Giải thích tất cả các phương án

  • Amazon DynamoDB with provisioned capacity mode and auto scaling
    ❌ Sai: DynamoDB là NoSQL (key-value/document), không phù hợp cho truy vấn phức tạp/ad-hoc trên bất kỳ fields nào (cần thiết kế partition/sort key, GSI - Global Secondary Indexes tốn kém và phức tạp). Provisioned mode yêu cầu đặt capacity trước, auto scaling giúp nhưng vẫn trả phí minimum cho idle time, không cost-effective cho traffic thấp/ngắt quãng. Không hỗ trợ SQL native cho reports nhiều fields.

  • Amazon DynamoDB with on-demand capacity mode
    ❌ Sai: On-demand pay-per-request tốt cho variable traffic (không cần provision), nhưng vẫn là NoSQL, khó xử lý one-time complex queries trên arbitrary fields (hiệu suất kém nếu không optimize schema, chi phí RCU/WCU cao cho scans/queries lớn). Không phải lựa chọn tối ưu cho relational workloads như reports khách hàng phức tạp.

  • Amazon Aurora with auto scaling enabled
    ❌ Sai: Aurora (provisioned cluster) hỗ trợ SQL tốt cho complex queries, auto scaling replicas (read) theo traffic, nhưng writer instance luôn chạy 24/7, trả phí fixed cho minimum size ngay cả khi idle/low traffic. Không tạm dừng tự động, chi phí cao hơn Serverless cho workload spiky/one-time (scale chậm hơn, quản lý thủ công nhiều).

🛠️ Tóm tắt so sánh: Aurora Serverless ✅ vượt trội về auto-pause/scale-zero và SQL support; DynamoDB ❌ thiếu relational flexibility; Provisioned options ❌ lãng phí chi phí idle time. Giải pháp này align với best practices AWS Well-Architected Framework (Cost Optimization pillar).

Câu 186
A financial services company runs an on-premises MySQL database for a critical application. The company is dissatisfied with its current database disaster recovery (DR) solution. The application experiences a significant amount of downtime whenever the database fails over to its DR facility. The application also experiences slower response times when reports are processed on the same database. To minimize the downtime in DR situations, the company has decided to migrate the database to AWS. The company requires a solution that is highly available and the most cost-effective.
Which solution meets these requirements?
  1. A Create an Amazon RDS for MySQL Multi-AZ DB instance and configure a read replica in a different Availability Zone. Configure the application to reference the replica instance endpoint and report queries to reference the primary DB instance endpoint.
  2. B Create an Amazon RDS for MySQL Multi-AZ DB instance and configure a read replica in a different Availability Zone. Configure the application to reference the primary DB instance endpoint and report queries to reference the replica instance endpoint.
  3. C Create an Amazon Aurora DB cluster and configure an Aurora Replica in a different Availability Zone. Configure the application to reference the cluster endpoint and report queries to reference the reader endpoint.
  4. D Create an Amazon Aurora DB cluster and configure an Aurora Replica in a different Availability Zone. Configure the application to reference the primary DB instance endpoint and report queries to reference the replica instance endpoint.
Xem giải thích

🧩 Phân tích chi tiết nội dung câu hỏi

Câu hỏi mô tả một công ty dịch vụ tài chính đang chạy MySQL database on-premises cho ứng dụng quan trọng, nhưng gặp vấn đề lớn với giải pháp disaster recovery (DR) hiện tại:

  • Downtime cao khi failover sang DR facility (do quá trình chuyển đổi chậm).
  • Response time chậm khi xử lý reports trên cùng database (vì reads và writes cạnh tranh tài nguyên).

Công ty quyết định migrate sang AWS, yêu cầu giải pháp:

  • Highly available (HA): Giảm thiểu downtime tối đa trong DR/failover.
  • Cost-effective nhất: Tiết kiệm chi phí so với các lựa chọn tương đương.

✅ Mục tiêu chính: Cần HA tự động (failover nhanh, sub-second nếu có thể), tách biệt reads (reports) khỏi writes (ứng dụng chính) để tránh chậm, và tương thích MySQL. Giải pháp phải dùng dịch vụ AWS managed như RDS hoặc Aurora (cả hai đều MySQL-compatible).

🛠️ Kiến thức AWS cập nhật 2026:

  • Amazon RDS Multi-AZ: Failover ~60-120 giây, standby sync replication.
  • Amazon Aurora (MySQL-compatible): Shared storage architecture, failover <30 giây (thường sub-second), cluster endpoints tự động hóa HA, rẻ hơn ~20-30% so với RDS Multi-AZ cho workload tương tự (theo AWS Pricing Calculator 2026).

📘 Tài liệu tham khảo:

✅ Đáp án đúng và lý do lựa chọn

Đáp án đúng: Create an Amazon Aurora DB cluster and configure an Aurora Replica in a different Availability Zone. Configure the application to reference the cluster endpoint and report queries to reference the reader endpoint.

Lý do chi tiết 🏆:

  • Aurora DB cluster cung cấp HA vượt trội với shared storage (6-way replication across 3 AZs mặc định), failover sub-second (nhanh hơn RDS Multi-AZ gấp 30-60 lần), giảm downtime DR tối đa.
  • Aurora Replica ở AZ khác tăng scalability reads, tách biệt workload reports (offload reads).
  • Cluster endpoint (writer endpoint): Tự động redirect writes đến primary instance mới nếu failover, ứng dụng không cần thay đổi code.
  • Reader endpoint: Tự động balance/load reads qua tất cả replicas, tối ưu reports mà không ảnh hưởng writes.
  • Cost-effective nhất: Aurora rẻ hơn RDS Multi-AZ cho multi-replica setups (storage shared, I/O optimized), phù hợp workload HA + reads heavy. Theo AWS 2026, tiết kiệm ~25% chi phí so với RDS equiv.

📋 Giải thích tất cả các phương án (đúng/sai)

  • ❌ Phương án SAI: Create an Amazon RDS for MySQL Multi-AZ DB instance and configure a read replica in a different Availability Zone. Configure the application to reference the replica instance endpoint and report queries to reference the primary DB instance endpoint.
    Lý do sai: RDS read replica chỉ dùng cho reads, không hỗ trợ writes (ứng dụng ref replica endpoint sẽ lỗi writes). Failover Multi-AZ vẫn ~1-2 phút (không minimize downtime). Reports trên primary gây chậm như hiện tại. Không HA tối ưu, kém cost-effective.

  • ❌ Phương án SAI: Create an Amazon RDS for MySQL Multi-AZ DB instance and configure a read replica in a different Availability Zone. Configure the application to reference the primary DB instance endpoint and report queries to reference the replica instance endpoint.
    Lý do sai: Cấu hình đúng hơn (app writes primary, reports replica), nhưng failover Multi-AZ chậm (~60-120s), không đáp ứng "minimize downtime". Read replica async (có lag), kém HA so Aurora. Chi phí cao hơn Aurora cho cùng tính năng.

  • ✅ Phương án ĐÚNG: Create an Amazon Aurora DB cluster and configure an Aurora Replica in a different Availability Zone. Configure the application to reference the cluster endpoint and report queries to reference the reader endpoint.
    Lý do đúng (tóm tắt): Aurora cluster HA sub-second, cluster endpoint tự động failover writes, reader endpoint scale reads. Giảm downtime DR, tách workload, cost-effective nhất (shared storage).

  • ❌ Phương án SAI: Create an Amazon Aurora DB cluster and configure an Aurora Replica in a different Availability Zone. Configure the application to reference the primary DB instance endpoint and report queries to reference the replica instance endpoint.
    Lý do sai: Primary instance endpoint không tự động failover (ứng dụng phải manual update nếu primary fail). Replica endpoint chỉ 1 replica (không scale reads tốt như reader endpoint). Mất lợi thế tự động hóa của Aurora cluster, kém HA.

🧠 Kết luận: Aurora là lựa chọn tối ưu nhất cho migrate MySQL on-prem sang AWS với HA + cost-effective (Well-Architected Reliability). Tránh RDS nếu cần sub-second failover! 🚀

Câu 187
A company with 500,000 employees needs to supply its employee list to an application used by human resources. Every 30 minutes, the data is exported using the LDAP service to load into a new Amazon DynamoDB table. The data model has a base table with Employee ID for the partition key and a global secondary index with Organization ID as the partition key.
While importing the data, a database specialist receives ProvisionedThroughputExceededException errors. After increasing the provisioned write capacity units
(WCUs) to 50,000, the specialist receives the same errors. Amazon CloudWatch metrics show a consumption of 1,500 WCUs.
What should the database specialist do to address the issue?
  1. A Change the data model to avoid hot partitions in the global secondary index.
  2. B Enable auto scaling for the table to automatically increase write capacity during bulk imports.
  3. C Modify the table to use on-demand capacity instead of provisioned capacity.
  4. D Increase the number of retries on the bulk loading application.
Xem giải thích

🧩 Phân tích chi tiết nội dung câu hỏi

Câu hỏi mô tả một tình huống thực tế trong AWS DynamoDB: Một công ty có 500.000 nhân viên cần cung cấp danh sách nhân viên cho ứng dụng HR. Dữ liệu được export từ LDAP service mỗi 30 phút và load vào một bảng DynamoDB mới. Mô hình dữ liệu bao gồm:

  • Bảng chính (base table): Partition Key (PK) là Employee ID (mỗi nhân viên có ID duy nhất, nên phân bố đều).
  • Global Secondary Index (GSI): PK là Organization ID (có thể nhiều nhân viên thuộc cùng một tổ chức, dẫn đến "hot partition" nếu write đồng thời vào cùng partition).

Vấn đề gặp phải:

  • Khi import dữ liệu, gặp lỗi ProvisionedThroughputExceededException (throttle write do vượt quá throughput provisioned ở mức partition).
  • Database specialist tăng Provisioned Write Capacity Units (WCUs) lên 50.000, nhưng lỗi vẫn xảy ra.
  • CloudWatch metrics chỉ tiêu thụ 1.500 WCUs (thấp so với provisioned, chứng tỏ vấn đề KHÔNG phải ở mức table tổng thể, mà ở mức partition cụ thể – hot partitions).

Nguyên nhân cốt lõi (dựa trên kiến thức DynamoDB cập nhật 2026): DynamoDB phân bổ throughput đều theo partition (mặc định 10 GB/partition, 3.000 RCUs/1.000 WCUs/partition). Với GSI PK là Organization ID, nếu nhiều nhân viên cùng org được write cùng lúc (bulk import), partition đó sẽ bị "hot" → throttle dù table có WCUs cao. Giải pháp cần tái thiết kế data model để phân tán write đều (ví dụ: thêm random suffix vào PK GSI).

✅ Đáp án đúng và lý do lựa chọn

Đáp án đúng: Change the data model to avoid hot partitions in the global secondary index.

Lý do 🛠️:

  • Vấn đề chính là hot partitions ở GSI do nhiều item cùng Organization ID được write đồng thời trong bulk import mỗi 30 phút → vượt throughput partition (không phụ thuộc tổng WCUs table).
  • Tăng WCUs table (50k) không giải quyết vì throttle xảy ra per-partition (CloudWatch chỉ 1.5k WCUs xác nhận điều này).
  • Giải pháp tối ưu: Thay đổi data model, ví dụ thêm random suffix hoặc timestamp/hash vào PK GSI (như OrganizationID#<random> hoặc OrganizationID#<batchId>), giúp phân tán write đều → tránh hot partitions.
  • Đây là best practice AWS cho bulk write với GSI (cập nhật DynamoDB 2026 vẫn giữ nguyên cơ chế partition throttling).

📋 Giải thích tất cả các phương án (đúng/sai)

  • ✅ Change the data model to avoid hot partitions in the global secondary index.
    Đúng vì đây là nguyên nhân gốc rễ (hot partitions ở GSI). Thay đổi model phân tán key giúp write đều, giải quyết throttle vĩnh viễn mà không lãng phí capacity. Hiệu quả cao cho bulk load định kỳ.

  • ❌ Enable auto scaling for the table to automatically increase write capacity during bulk imports.
    Sai vì auto scaling chỉ tăng/giảm tổng WCUs table (target 70% utilization), nhưng không giải quyết hot partitions per-partition. Bulk import vẫn throttle partition cụ thể dù table scale lên cao (CloudWatch 1.5k WCUs đã chứng minh).

  • ❌ Modify the table to use on-demand capacity instead of provisioned capacity.
    Sai vì on-demand vẫn áp dụng giới hạn per-partition (burst lên 500k RCUs/40k WCUs ban đầu, sau scale dần). Hot partitions vẫn throttle ngay lập tức trong burst import lớn (500k items). Không phù hợp bulk write lặp lại mỗi 30 phút, chi phí cao hơn nếu không tối ưu model.

  • ❌ Increase the number of retries on the bulk loading application.
    Sai vì chỉ là workaround tạm thời, không giải quyết gốc rễ hot partitions → lỗi lặp lại vô tận, tăng latency/cost (retry exponential backoff vẫn throttle). AWS khuyến nghị fix data model thay vì retry.

📘 Tài liệu tham khảo (AWS cập nhật mới nhất 2026)

Hy vọng phân tích này giúp bạn ôn thi DOP-C02 hiệu quả! 🚀 Nếu cần thêm ví dụ code Terraform/CLI, hãy hỏi nhé!

Câu 188
A company has an application that uses an Amazon DynamoDB table as its data store. During normal business days, the throughput requirements from the application are uniform and consist of 5 standard write calls per second to the DynamoDB table. Each write call has 2 KB of data.
For 1 hour each day, the company runs an additional automated job on the DynamoDB table that makes 20 write requests per second. No other application writes to the DynamoDB table. The DynamoDB table does not have to meet any additional capacity requirements.
How should a database specialist configure the DynamoDB table's capacity to meet these requirements MOST cost-effectively?
  1. A Use DynamoDB provisioned capacity with 5 WCUs and auto scaling.
  2. B Use DynamoDB provisioned capacity with 5 WCUs and a write-through cache that DynamoDB Accelerator (DAX) provides.
  3. C Use DynamoDB provisioned capacity with 10 WCUs and auto scaling.
  4. D Use DynamoDB provisioned capacity with 10 WCUs and no auto scaling.
Xem giải thích

🧩 Phân tích chi tiết nội dung câu hỏi

Câu hỏi tập trung vào việc cấu hình dung lượng (capacity) cho bảng Amazon DynamoDB một cách tiết kiệm chi phí nhất (MOST cost-effectively) để đáp ứng yêu cầu throughput write.

📊 Yêu cầu cụ thể:

  • Trong ngày thường: Ứng dụng thực hiện 5 write calls/giây, mỗi write chứa 2 KB dữ liệu.
    • Mỗi write unit (WCU) trong DynamoDB xử lý 1 KB write/giây.
    • Vậy: 1 write (2 KB) cần 2 WCU → 5 writes/giây × 2 WCU = 10 WCU liên tục.
  • 1 giờ mỗi ngày: Job tự động thêm 20 write requests/giây (cũng giả định 2 KB/request, vì không chỉ rõ khác → 20 × 2 = 40 WCU).
  • Không có write nào khác, và bảng không cần capacity bổ sung.

🎯 Mục tiêu: Chọn cấu hình provisioned capacity (dung lượng dự trữ) với chi phí thấp nhất, tránh throttling (hạn chế) ở peak (40 WCU/1h) nhưng không lãng phí ở baseline (10 WCU).

Lưu ý kiến thức AWS mới nhất (2026): DynamoDB provisioned capacity hỗ trợ auto scaling dựa trên target utilization (mặc định 70%), scale up/down tự động trong phút để xử lý burst mà không cần over-provision. On-demand hoặc reserved capacity có thể xem xét, nhưng câu hỏi chỉ định provisioned trong options. (Nguồn: AWS DynamoDB Developer Guide - Capacity Modes, cập nhật 2025).

✅ Đáp án đúng: Use DynamoDB provisioned capacity with 10 WCUs and auto scaling

Lý do chọn:

  • Baseline 10 WCU khớp chính xác nhu cầu thường ngày → Tiết kiệm chi phí hàng ngày.
  • Auto scaling kích hoạt khi tải tăng (ví dụ: >70% utilization → scale lên 40 WCU cho 1h peak), sau đó scale down về 10 WCU → Tránh over-provision fixed capacity (như 40 WCU cả ngày, tốn kém gấp 4 lần).
  • Cost-effective nhất: Chỉ trả cho 10 WCU base + phí scale tạm thời, thay vì fixed cao hoặc on-demand (đắt hơn provisioned cho workload predictable).
  • 🛠️ Cách config: Sử dụng Application Auto Scaling trên DynamoDB, set min capacity 10 WCU, max 40+ WCU, target 70%.

📋 Phân tích tất cả các phương án (Giữ nguyên text Anh, giải thích tiếng Việt)

  • ❌ [SAI] Use DynamoDB provisioned capacity with 5 WCUs and auto scaling.
    Giải thích sai: Baseline đã cần 10 WCU, chỉ 5 WCU sẽ throttle ngay cả ngày thường (5 writes × 2KB > 5 WCU). Auto scaling có thể scale up peak, nhưng baseline thấp quá → thường xuyên scale up/down, tốn phí và không ổn định. Không cost-effective vì không khớp nhu cầu thực.

  • ❌ [SAI] Use DynamoDB provisioned capacity with 5 WCUs and a write-through cache that DynamoDB Accelerator (DAX) provides.
    Giải thích sai: DAX là in-memory cache chủ yếu cho READ (read-through/write-through), không tăng write capacity trực tiếp đến DynamoDB table. Write vẫn đi qua table → 5 WCU vẫn throttle baseline và peak. Sai lầm phổ biến: DAX không thay thế WCU provisioned cho write-heavy workload.

  • ✅ [ĐÚNG] Use DynamoDB provisioned capacity with 10 WCUs and auto scaling.
    Giải thích đúng: Như trên – 10 WCU base cho baseline, auto scaling handle burst 40 WCU/1h → Hoàn hảo, tiết kiệm (chỉ scale khi cần). AWS recommend cho predictable baseline + periodic spikes.

  • ❌ [SAI] Use DynamoDB provisioned capacity with 10 WCUs and no auto scaling.
    Giải thích sai: 10 WCU OK cho baseline, nhưng peak 40 WCU sẽ throttle nghiêm trọng (ProvisionedThroughputExceededException). Không scale → Dừng job 1h/ngày, không đáp ứng yêu cầu. Phải fixed 40 WCU để an toàn → Tốn kém gấp 4 lần baseline.

📘 Tài liệu tham khảo AWS (cập nhật 2026)

Hy vọng phân tích này giúp bạn ôn thi DOP-C02 hiệu quả! 🚀 Nếu cần demo CloudFormation config, hỏi thêm nhé!

Câu 189
A company wants to build a new invoicing service for its cloud-native application on AWS. The company has a small development team and wants to focus on service feature development and minimize operations and maintenance as much as possible. The company expects the service to handle billions of requests and millions of new records every day. The service feature requirements, including data access patterns are well-defined. The service has an availability target of
99.99% with a milliseconds latency requirement. The database for the service will be the system of record for invoicing data.
Which database solution meets these requirements at the LOWEST cost?
  1. A Amazon Neptune
  2. B Amazon Aurora PostgreSQL Serverless
  3. C Amazon RDS for PostgreSQL
  4. D Amazon DynamoDB
Xem giải thích

🧩 Phân tích nội dung câu hỏi

Câu hỏi tập trung vào việc chọn giải pháp cơ sở dữ liệu (database) phù hợp nhất cho một dịch vụ invoicing (hóa đơn) trong ứng dụng cloud-native trên AWS. Các yêu cầu chính bao gồm:

  • Team dev nhỏ: Ưu tiên giảm thiểu công việc vận hành (operations) và bảo trì (maintenance) để tập trung phát triển tính năng.
  • Quy mô lớn: Xử lý hàng tỷ request và hàng triệu record mới mỗi ngày (high throughput, scalable).
  • Yêu cầu tính năng rõ ràng: Bao gồm các mẫu truy cập dữ liệu (data access patterns) đã được định nghĩa sẵn.
  • SLA cao: Độ khả dụng 99.99% (four 9s) và độ trễ milliseconds (low latency).
  • DB là system of record: Lưu trữ dữ liệu invoicing chính thức, cần độ tin cậy cao.
  • Tiêu chí quyết định: Chi phí thấp nhất (LOWEST cost) trong khi đáp ứng đầy đủ yêu cầu.

🛠️ Tóm tắt vấn đề: Cần một DB serverless hoặc tự động scale, pay-per-use để giảm ops, chịu tải cao với chi phí tối ưu, phù hợp NoSQL vì invoicing thường có access patterns đơn giản (lookup by ID, invoice number).

✅ Đáp án đúng: Amazon DynamoDB

Lý do lựa chọn:
DynamoDB là dịch vụ NoSQL serverless hoàn hảo cho trường hợp này. Nó tự động scale theo nhu cầu (on-demand capacity mode), xử lý hàng tỷ request/ngày mà không cần quản lý server, đảm bảo latency single-digit milliseconds và 99.99% availability (multi-AZ default). Với team nhỏ, zero maintenance (không provision capacity, auto-backup, global tables). Chi phí thấp nhất nhờ pay-per-request (không phí idle), phù hợp billions requests và millions records/ngày. Invoicing data dễ model với partition/sort keys (ví dụ: InvoiceID làm primary key).

📘 Tài liệu tham khảo:

📋 Giải thích tất cả các phương án

Dưới đây là phân tích chi tiết từng lựa chọn, giữ nguyên văn bản gốc bằng tiếng Anh. Tôi đánh dấu ✅ đúng hoặc ❌ sai, kèm lý do cụ thể bằng tiếng Việt:

  • ❌ Amazon Neptune
    Neptune là graph database chuyên cho dữ liệu quan hệ phức tạp (nodes/edges, như social networks). Không phù hợp invoicing (không cần graph queries), scale kém hơn DynamoDB cho billions requests, chi phí cao hơn (provisioned instances, không true serverless). Ops phức tạp hơn, latency cao hơn cho non-graph workloads. Không đáp ứng lowest cost và giảm maintenance.

  • ❌ Amazon Aurora PostgreSQL Serverless
    Aurora Serverless v2 (cập nhật 2024) scale nhanh (0.5 ACU), hỗ trợ PostgreSQL, latency thấp (~ms), availability 99.99%. Tuy nhiên, chi phí cao hơn DynamoDB vì tính theo Aurora Capacity Units (ACU), vẫn có phí minimum dù serverless. Phù hợp relational data nhưng ops vẫn cần tuning (query optimization, backups), không tối ưu cho hàng tỷ requests/ngày như NoSQL. Không phải lowest cost cho high-throughput key-value patterns.

  • ❌ Amazon RDS for PostgreSQL
    RDS PostgreSQL là provisioned relational DB, cần manual scaling instances, multi-AZ cho 99.99%. Latency ms nhưng không tự động scale cho billions requests (cần read replicas, auto-scaling groups). Chi phí cao (instance hours + storage), ops nặng (patching, monitoring). Không serverless, team nhỏ sẽ tốn thời gian maintenance, không lowest cost cho workload lớn.

  • ✅ Amazon DynamoDB
    (Như đã giải thích ở trên) – Hoàn hảo khớp tất cả: serverless, zero-ops, scale infinite, latency ms, 99.99% SLA, lowest cost pay-per-use cho quy mô này.

🛠️ Kết luận nổi bật: DynamoDB vượt trội nhờ serverless NoSQL optimized cho high-scale apps như invoicing (ví dụ: Netflix, Amazon dùng cho billing). Các lựa chọn khác relational/graph, tốn kém hơn cho workload này. Nếu cần relational phức tạp, Aurora tốt hơn nhưng không lowest cost! 🚀

Câu 190
Application developers have reported that an application is running slower as more users are added. The application database is running on an Amazon Aurora
DB cluster with an Aurora Replica. The application is written to take advantage of read scaling through reader endpoints. A database specialist looks at the performance metrics of the database and determines that, as new users were added to the database, the primary instance CPU utilization steadily increased while the Aurora Replica CPU utilization remained steady.
How can the database specialist improve database performance while ensuring minimal downtime?
  1. A Modify the Aurora DB cluster to add more replicas until the overall load stabilizes. Then, reduce the number of replicas once the application meets service level objectives.
  2. B Modify the primary instance to a larger instance size that offers more CPU capacity.
  3. C Modify a replica to a larger instance size that has more CPU capacity. Then, promote the modified replica.
  4. D Restore the Aurora DB cluster to one that has an instance size with more CPU capacity. Then, swap the names of the old and new DB clusters.
Xem giải thích

🧩 Phân tích chi tiết nội dung câu hỏi

Câu hỏi mô tả một tình huống thực tế trong AWS Aurora DB cluster:
📈 Vấn đề chính: Ứng dụng chạy chậm hơn khi thêm nhiều user. Database sử dụng Amazon Aurora DB cluster với Aurora Replica. Ứng dụng được thiết kế tận dụng read scaling qua reader endpoints (endpoint đọc dành cho các replica để phân tải reads).
🔍 Metrics quan trọng:

  • Primary instance CPU tăng dần khi thêm user (chỉ ra load writes tăng cao, vì writes chỉ xử lý trên primary).
  • Aurora Replica CPU ổn định (load reads không tăng tương ứng, replicas đang dư thừa).

🎯 Mục tiêu: Cải thiện performance database với minimal downtime (thời gian ngừng dịch vụ thấp nhất có thể).

🛠️ Bối cảnh AWS Aurora (cập nhật 2026): Aurora hỗ trợ horizontal scaling cho reads qua replicas, nhưng writes chỉ trên primary. Scaling vertical (tăng instance size) cho primary cần cẩn thận để tránh downtime. Failover/promote replica là cách zero-downtime chuẩn.

📘 Tài liệu tham khảo:


✅ Đáp án đúng và lý do lựa chọn

Đáp án đúng: Modify a replica to a larger instance size that has more CPU capacity. Then, promote the modified replica.

🧠 Lý do chi tiết:

  • Vấn đề cốt lõi là primary CPU cao do writes tăng, replicas dư thừa (CPU ổn định).
  • Bước 1: Scale up một replica thành instance lớn hơn (hỗ trợ zero-downtime vì replicas độc lập, không ảnh hưởng primary hay app).
  • Bước 2: Promote replica thành primary mới → Failover tự động/mạnh mẽ, chuyển primary mới (có CPU cao hơn) mà downtime <60 giây (thường zero với reader endpoints). App chỉ cần reconnect qua cluster endpoint.
  • ✅ Tối ưu: Giải quyết writes bottleneck, tận dụng replicas sẵn có, minimal downtime theo best practice AWS.

📋 Phân tích tất cả các phương án (đúng/sai)

  • Phương án A: Modify the Aurora DB cluster to add more replicas until the overall load stabilizes. Then, reduce the number of replicas once the application meets service level objectives.
    ❌ Sai vì: Thêm replicas chỉ scale reads (qua reader endpoints), nhưng metrics cho thấy replica CPU ổn định (reads không phải bottleneck). Primary CPU cao do writes, thêm replicas không giúp writes. Giảm replicas sau cũng không giải quyết gốc rễ, có thể tăng chi phí không cần thiết.

  • Phương án B: Modify the primary instance to a larger instance size that offers more CPU capacity.
    ❌ Sai vì: Scaling vertical primary instance trong Aurora gây downtime đáng kể (5-15 phút hoặc hơn, tùy cluster), vì primary phải restart để apply instance size mới. Không đáp ứng "minimal downtime". (AWS khuyến cáo tránh scale primary trực tiếp nếu có replicas).

  • Phương án C: Modify a replica to a larger instance size that has more CPU capacity. Then, promote the modified replica.
    ✅ Đúng (như phân tích trên): Scale replica zero-downtime → Promote failover nhanh, primary mới có CPU cao xử lý writes tốt hơn. Hoàn hảo cho tình huống!

  • Phương án D: Restore the Aurora DB cluster to one that has an instance size with more CPU capacity. Then, swap the names of the old and new DB clusters.
    ❌ Sai vì: Restore cluster từ snapshot mất thời gian dài (giờ tùy data size), tạo cluster mới với instance lớn → Swap names (DNS change) gây downtime cao (app reconnect chậm, cache DNS). Không minimal downtime, phức tạp hơn promote replica. AWS ưu tiên failover native hơn restore.

🎉 Kết luận: Phương án C là best practice AWS cho scaling writes với high availability! Nếu áp dụng thực tế, monitor qua CloudWatch và Performance Insights.