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

Tìm thấy 358 câu.

Câu 1 Chọn nhiều đáp án
A company is using an Amazon ElastiCache for Redis cluster to host its online shopping website. Shoppers receive the following error when the website's application queries the cluster:

Which solutions will resolve this memory issues with the LEAST amount of effort? (Choose three.)
  1. A Reduce the TTL value for keys on the node.
  2. B Choose a larger node type.
  3. C Test different values in the parameter group for the maxmemory-policy parameter to find the ideal value to use.
  4. D Increase the number of nodes.
  5. E Monitor the EngineCPUUtilization Amazon CloudWatch metric. Create an AWS Lambda function to delete keys on nodes when a threshold is reached.
  6. F Increase the TTL value for keys on the node.
Xem giải thích

Đáp án

A, B và C — giảm TTL của khoá, chọn loại node lớn hơn, và thử các giá trị maxmemory-policy

Vì sao đúng

Lỗi mà ứng dụng nhận về là dấu hiệu node Redis hết bộ nhớ. Ba phương án này tấn công đúng nguyên nhân đó theo ba hướng khác nhau:

  • B. Node lớn hơn — tăng thẳng dung lượng bộ nhớ, cách trực tiếp nhất.
  • A. Giảm TTL — khoá hết hạn sớm hơn nên bị dọn sớm hơn, giảm áp lực bộ nhớ.
  • C. Chỉnh maxmemory-policy — quyết định Redis loại bỏ khoá nào khi đầy. Mặc định noeviction sẽ trả lỗi thay vì loại bỏ; đổi sang chính sách kiểu allkeys-lru thì nó tự nhường chỗ cho dữ liệu mới.

Vì sao các phương án khác sai

  • D. Tăng số node — với cụm không bật chế độ cluster, thêm node là thêm bản sao đọc; mỗi bản sao vẫn giữ đúng tập dữ liệu đó nên bộ nhớ mỗi node không tăng thêm chút nào.
  • E. Theo dõi EngineCPUUtilization — chỉ số về CPU, không phải bộ nhớ; sai triệu chứng.
  • F. Tăng TTL — giữ khoá lâu hơn, làm vấn đề nặng thêm.
Câu 2
A company has deployed an e-commerce web application in a new AWS account. An Amazon RDS for MySQL Multi-AZ DB instance is part of this deployment with a database-1.xxxxxxxxxxxx.us-east-1.rds.amazonaws.com endpoint listening on port 3306. The company's Database Specialist is able to log in to MySQL and run queries from the bastion host using these details.
When users try to utilize the application hosted in the AWS account, they are presented with a generic error message. The application servers are logging a `could not connect to server: Connection times out` error message to Amazon CloudWatch Logs.
What is the cause of this error?
  1. A The user name and password the application is using are incorrect.
  2. B The security group assigned to the application servers does not have the necessary rules to allow inbound connections from the DB instance.
  3. C The security group assigned to the DB instance does not have the necessary rules to allow inbound connections from the application servers.
  4. D The user name and password are correct, but the user is not authorized to use the DB instance.
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 triển khai ứng dụng web thương mại điện tử (e-commerce) trên tài khoản AWS mới. Phần quan trọng là Amazon RDS for MySQL Multi-AZ DB instance với endpoint database-1.xxxxxxxxxxxx.us-east-1.rds.amazonaws.com lắng nghe trên port 3306.

  • Database Specialist có thể đăng nhập MySQL và chạy query thành công từ bastion host bằng thông tin này. ✅ Điều này chứng tỏ:

    • Username/password đúng.
    • User có quyền truy cập DB.
    • Kết nối mạng từ bastion host đến DB hoạt động bình thường.
  • Tuy nhiên, khi người dùng sử dụng ứng dụng, họ gặp lỗi generic. Application servers ghi log lỗi could not connect to server: Connection times out vào Amazon CloudWatch Logs. ❌

Vấn đề cốt lõi: Lỗi "Connection times out" chỉ ra vấn đề mạng (network timeout), không phải lỗi xác thực (auth) hay quyền hạn. App servers không thể kết nối đến RDS endpoint, dù cùng VPC hoặc tài khoản AWS mới. Nguyên nhân thường liên quan đến Security Groups (SG) hoặc Network ACLs (NACLs), nhưng tập trung vào SG vì RDS yêu cầu inbound rules cụ thể cho client connections.

🛠️ Bối cảnh AWS (cập nhật đến 2026): RDS Multi-AZ tự động failover, nhưng security vẫn dựa trên VPC Security Groups. Endpoint RDS chỉ accessible từ inbound traffic được phép qua SG của DB instance. App servers (EC2?) cần outbound đến port 3306 của DB SG, và DB SG cần inbound rule từ SG/IP của app servers.

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

Đáp án đúng: The security group assigned to the DB instance does not have the necessary rules to allow inbound connections from the application servers.

Lý do chi tiết:

  • Lỗi timeout xảy ra vì app servers không thể reach DB endpoint do SG của DB instance thiếu inbound rule cho phép traffic từ app servers (thường là SG của EC2 hoặc CIDR/IP của app).
  • Bastion host connect được → SG DB đã allow từ bastion (có thể là SSH từ IP cụ thể hoặc SG bastion).
  • Trong VPC, kết nối RDS yêu cầu self-referential SG rules hoặc cross-SG: DB SG inbound TCP 3306 từ SG của app servers.
  • AWS best practice (2026): Sử dụng least privilege – chỉ allow cụ thể từ app tier, không public.

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

  • ❌ [SAI] The user name and password the application is using are incorrect.
    Giải thích sai: Nếu username/password sai, lỗi sẽ là auth failure (ví dụ: "Access denied"), không phải timeout. Specialist đã login thành công từ bastion → credentials đúng và hoạt động.

  • ❌ [SAI] The security group assigned to the application servers does not have the necessary rules to allow inbound connections from the DB instance.
    Giải thích sai: App servers là client (kết nối ra ngoài đến DB port 3306), không phải server nhận inbound từ DB. SG app chỉ cần outbound rule (mặc định allow all). DB không initiate connection vào app → rule này không liên quan.

  • ✅ [ĐÚNG] The security group assigned to the DB instance does not have the necessary rules to allow inbound connections from the application servers.
    Giải thích đúng: DB SG kiểm soát inbound traffic đến endpoint. Phải có rule: TCP 3306 từ SG của app servers hoặc IP/CIDR của app. Thiếu rule → timeout từ app, nhưng bastion (có rule riêng) OK. Phù hợp AWS RDS networking (Multi-AZ không thay đổi điều này).

  • ❌ [SAI] The user name and password are correct, but the user is not authorized to use the DB instance.
    Giải thích sai: Specialist đã query thành công → user có quyền (GRANTs). Lỗi auth sẽ là "Access denied for user", không phải timeout (network layer). App dùng cùng credentials → quyền OK.

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

🛠️ Khuyến nghị fix: Thêm inbound rule vào DB SG: Source = SG của app servers (hoặc 10.0.0.0/16 VPC CIDR), Port 3306. Test bằng telnet từ app: telnet database-1... 3306. Monitor CloudWatch RDS metrics (Connections).

Câu 3 Chọn nhiều đáp án
An AWS CloudFormation stack that included an Amazon RDS DB instance was accidentally deleted and recent data was lost. A Database Specialist needs to add
RDS settings to the CloudFormation template to reduce the chance of accidental instance data loss in the future.
Which settings will meet this requirement? (Choose three.)
  1. A Set DeletionProtection to True
  2. B Set MultiAZ to True
  3. C Set TerminationProtection to True
  4. D Set DeleteAutomatedBackups to False
  5. E Set DeletionPolicy to Delete
  6. F Set DeletionPolicy to Retain
Xem giải thích

🧩 Giải thích nội dung câu hỏi

Câu hỏi tập trung vào tình huống một stack CloudFormation chứa Amazon RDS DB instance bị xóa ngẫu nhiên (accidentally deleted), dẫn đến mất dữ liệu gần đây. Một Database Specialist cần thêm các cài đặt RDS vào CloudFormation template để giảm thiểu rủi ro mất dữ liệu trong tương lai.
📌 Yêu cầu chính: Chọn 3 cài đặt giúp bảo vệ dữ liệu RDS khi stack bị xóa, dựa trên các thuộc tính của resource AWS::RDS::DBInstance trong CloudFormation.
🛠️ Ngữ cảnh AWS (cập nhật đến 2026): CloudFormation cho phép kiểm soát hành vi xóa resource qua DeletionPolicy, và RDS có các thuộc tính bảo vệ riêng như DeletionProtection, DeleteAutomatedBackups. Những cài đặt này ngăn chặn xóa dữ liệu vĩnh viễn hoặc giữ backup.

✅ Đáp án đúng (chọn 3)

Các lựa chọn đúng là:

  • Set DeletionProtection to True
  • Set DeleteAutomatedBackups to False
  • Set DeletionPolicy to Retain

Lý do lựa chọn:
Những cài đặt này trực tiếp ngăn chặn mất dữ liệu khi stack bị xóa:

  • DeletionProtection=True chặn xóa DB instance ngay cả qua CloudFormation.
  • DeleteAutomatedBackups=False giữ automated backups sau khi xóa instance.
  • DeletionPolicy=Retain giữ nguyên DB instance không bị xóa theo stack.
    Kết hợp chúng tạo lớp bảo vệ đa tầng, phù hợp với best practice DevOps trên AWS (giảm downtime và data loss).

📋 Phân tích chi tiết từng phương án

Dưới đây là giải thích tất cả các phương án, đánh dấu ✅ (đúng) hoặc ❌ (sai), giữ nguyên văn bản gốc tiếng Anh. Phân tích dựa trên tài liệu AWS CloudFormation và RDS mới nhất (2026).

  • ✅ Set DeletionProtection to True
    🛡️ Đúng: Thuộc tính DeletionProtection của RDS DB instance (trong CloudFormation AWS::RDS::DBInstance) được đặt true sẽ ngăn chặn xóa DB instance qua bất kỳ phương thức nào (console, CLI, SDK, hoặc CloudFormation). Phải tắt trước (false) mới xóa được. Giúp tránh xóa ngẫu nhiên, bảo vệ dữ liệu chính.

  • ❌ Set MultiAZ to True
    🚫 Sai: MultiAZ kích hoạt deployment đa AZ cho high availability (failover tự động), nhưng không liên quan đến bảo vệ xóa stack hoặc mất dữ liệu khi delete. Nó chỉ cải thiện tính sẵn sàng, không ngăn chặn deletion.

  • ❌ Set TerminationProtection to True
    🚫 Sai: TerminationProtection là thuộc tính của EC2 Instance (không phải RDS), dùng để bảo vệ EC2 khỏi xóa qua Auto Scaling hoặc console. RDS không hỗ trợ thuộc tính này trong CloudFormation, nên không áp dụng được.

  • ✅ Set DeleteAutomatedBackups to False
    💾 Đúng: Thuộc tính DeleteAutomatedBackups mặc định true (xóa backup tự động khi delete instance). Đặt false sẽ giữ lại tất cả automated backups ngay cả sau khi xóa DB instance/stack, cho phép khôi phục dữ liệu sau. Rất hữu ích chống mất data gần đây.

  • ❌ Set DeletionPolicy to Delete
    🚫 Sai: DeletionPolicy=Delete là mặc định của CloudFormation, nghĩa là xóa hoàn toàn resource (bao gồm RDS) khi stack bị delete. Điều này tăng rủi ro mất dữ liệu, trái ngược yêu cầu bảo vệ.

  • ✅ Set DeletionPolicy to Retain
    🔒 Đúng: DeletionPolicy=Retain trong CloudFormation resource (như AWS::RDS::DBInstance) sẽ giữ nguyên DB instance độc lập với stack khi delete stack. Instance vẫn chạy, dữ liệu an toàn, chỉ cần update stack sau để quản lý.

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

Câu 4
A Database Specialist is troubleshooting an application connection failure on an Amazon Aurora DB cluster with multiple Aurora Replicas that had been running with no issues for the past 2 months. The connection failure lasted for 5 minutes and corrected itself after that. The Database Specialist reviewed the Amazon
RDS events and determined a failover event occurred at that time. The failover process took around 15 seconds to complete.
What is the MOST likely cause of the 5-minute connection outage?
  1. A After a database crash, Aurora needed to replay the redo log from the last database checkpoint
  2. B The client-side application is caching the DNS data and its TTL is set too high
  3. C After failover, the Aurora DB cluster needs time to warm up before accepting client connections
  4. D There were no active Aurora Replicas in the Aurora DB cluster
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 Database Specialist đang khắc phục sự cố kết nối ứng dụng thất bại với Amazon Aurora DB cluster có nhiều Aurora Replicas. Cluster này đã chạy ổn định suốt 2 tháng qua. Sự cố xảy ra với thời lượng 5 phút và tự động khắc phục sau đó. Chuyên gia kiểm tra Amazon RDS events và phát hiện có failover event tại thời điểm đó, với thời gian failover chỉ khoảng 15 giây.
🛠️ Vấn đề cốt lõi: Failover rất nhanh (15s), nhưng outage kéo dài đến 5 phút → cần tìm nguyên nhân gây delay thêm sau failover. Đây là kiến thức cốt lõi về Aurora high availability (failover tự động khi primary fail, replicas promote nhanh chóng). Theo tài liệu AWS mới nhất (2024-2026), Aurora failover thường <30s nhờ storage layer replicate liên tục, không cần full recovery như RDS truyền thống.

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

Đáp án đúng: The client-side application is caching the DNS data and its TTL is set too high
📘 Lý do chi tiết:
Sau failover, cluster writer endpoint (DNS) thay đổi để chỉ đến instance mới làm primary. Tuy nhiên, ứng dụng client-side cache DNS với TTL cao (mặc định AWS Route 53 TTL cho RDS/Aurora endpoints là 900 giây ~15 phút). Kết quả: Client vẫn cố connect đến old endpoint (đã invalid) trong ~5 phút (TTL chưa expire), dù failover chỉ 15s. Sau TTL hết hạn, DNS resolve mới → kết nối tự sửa. Đây là nguyên nhân phổ biến nhất (MOST likely) khớp timeline: 15s failover + ~5 phút DNS cache. Giải pháp: Sử dụng cluster endpoint thay writer, hoặc giảm TTL/retry logic client-side.

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

Dưới đây là giải thích từng phương án một, giữ nguyên văn bản gốc tiếng Anh. Phân tích dựa trên Aurora architecture mới nhất (Aurora Serverless v2 & MySQL/PostgreSQL 2024-2026): Failover dùng quorum replicas, storage replay <30s, không full checkpoint như OLTP truyền thống.

  • After a database crash, Aurora needed to replay the redo log from the last database checkpoint
    ❌ Sai vì: Aurora không replay redo log đầy đủ sau failover như engine crash thông thường (ví dụ MySQL standalone). Aurora dùng shared storage layer replicate 6-way (multi-AZ), chỉ cần catch-up logs từ storage (~giây), không checkpoint dài. Timeline không khớp: Replay chỉ <30s, không giải thích 5 phút outage. (Aurora loại bỏ WAL redo overhead.)

  • The client-side application is caching the DNS data and its TTL is set too high
    ✅ Đúng vì: Như giải thích trên, DNS TTL caching ở client là bottleneck phổ biến sau failover. AWS khuyến cáo dùng retry với backoff hoặc cluster endpoint (read/write auto-route). Khớp chính xác 15s failover + 5 phút delay.

  • After failover, the Aurora DB cluster needs time to warm up before accepting client connections
    ❌ Sai vì: Aurora không cần warm-up đáng kể sau failover. Buffer cache shared qua storage layer, replicas luôn warm (hot standby). Instance mới promote chấp nhận connection ngay lập tức (<30s). Không có "warm-up period" official trong docs AWS.

  • There were no active Aurora Replicas in the Aurora DB cluster
    ❌ Sai vì: Câu hỏi chỉ rõ multiple Aurora Replicas, và failover thành công (15s) → phải có ít nhất 1 replica active (quorum 2/3 cho promote). Nếu không replica, failover fail hoặc manual, không tự động + RDS events xác nhận.

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

💡 Lời khuyên DevOps: Luôn implement connection pooling + retry exponential backoff (ví dụ Java HikariCP) và monitor CloudWatch RDS metrics (CPUConnectionFailed, ReplicaLag). Test failover bằng chaos engineering với AWS Fault Injection Simulator! 🚀

Câu 5
A company is deploying a solution in Amazon Aurora by migrating from an on-premises system. The IT department has established an AWS Direct Connect link from the company's data center. The company's Database Specialist has selected the option to require SSL/TLS for connectivity to prevent plaintext data from being set over the network. The migration appears to be working successfully, and the data can be queried from a desktop machine.
Two Data Analysts have been asked to query and validate the data in the new Aurora DB cluster. Both Analysts are unable to connect to Aurora. Their user names and passwords have been verified as valid and the Database Specialist can connect to the DB cluster using their accounts. The Database Specialist also verified that the security group configuration allows network from all corporate IP addresses.
What should the Database Specialist do to correct the Data Analysts' inability to connect?
  1. A Restart the DB cluster to apply the SSL change.
  2. B Instruct the Data Analysts to download the root certificate and use the SSL certificate on the connection string to connect.
  3. C Add explicit mappings between the Data Analysts' IP addresses and the instance in the security group assigned to the DB cluster.
  4. D Modify the Data Analysts' local client firewall to allow network traffic to AWS.
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 đang migrate hệ thống on-premises sang Amazon Aurora (một dịch vụ RDS managed database của AWS, hỗ trợ MySQL/PostgreSQL với hiệu suất cao). Họ sử dụng AWS Direct Connect để kết nối từ data center công ty đến AWS, đảm bảo kết nối private và ổn định.

Vấn đề chính:

  • Database Specialist đã bật tùy chọn yêu cầu SSL/TLS cho tất cả kết nối đến Aurora cluster để tránh dữ liệu plaintext truyền qua mạng (tăng bảo mật).
  • Quá trình migration thành công: Dữ liệu có thể query từ máy desktop (của Specialist).
  • Tuy nhiên, hai Data Analysts không connect được, dù:
    • Username/password hợp lệ (Specialist test OK).
    • Security group đã cho phép traffic từ tất cả IP corporate.

Mục tiêu: Tìm giải pháp để Data Analysts connect thành công. Đây là vấn đề phổ biến khi enable SSL/TLS enforced trên Aurora (theo docs AWS cập nhật 2024-2026), client phải sử dụng certificate chain đúng cách.

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

Đáp án đúng: Instruct the Data Analysts to download the root certificate and use the SSL certificate on the connection string to connect.

Lý do 🛠️:

  • Khi bật "Require SSL/TLS" trên Aurora DB cluster (parameter rds.force_ssl=1 hoặc qua console), tất cả client phải sử dụng SSL/TLS với root certificate hợp lệ từ AWS để verify server certificate. Nếu không, kết nối bị từ chối ngay lập tức (lỗi như "SSL connection error" hoặc "Access denied").
  • Database Specialist connect được vì có lẽ đã dùng connection string với SSL cert trên desktop. Analysts (có thể dùng tool như MySQL Workbench, DBeaver, hoặc psql) chưa cấu hình SSL cert trong connection string (ví dụ: ?ssl-mode=REQUIRED&ssl-ca=/path/to/rds-ca-bundle.pem).
  • Giải pháp: Hướng dẫn Analysts download root cert bundle mới nhất (rds-combined-ca-bundle.pem hoặc rds-ca-rsa2048-g1.pem cho phiên bản 2024+), rồi thêm vào connection string. Không cần thay đổi config AWS, chỉ fix client-side. Điều này khớp với best practice AWS DevOps cho secure migration.

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

  • Restart the DB cluster to apply the SSL change. ❌
    Sai vì: Tùy chọn SSL/TLS được apply ngay lập tức khi enable qua console/CLI/API, không cần restart cluster (Aurora hỗ trợ dynamic parameter groups từ 2019+). Restart chỉ gây downtime không cần thiết và không giải quyết vấn đề client cert. Migration đã thành công, Specialist connect OK → không liên quan.

  • Instruct the Data Analysts to download the root certificate and use the SSL certificate on the connection string to connect. ✅
    Đúng vì: Như giải thích trên, enforced SSL yêu cầu client cung cấp root CA cert để handshake TLS. Download từ AWS (https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/UsingWithRDS.SSL.html), thêm vào JDBC/ODBC string (ví dụ MySQL: jdbc:mysql://endpoint:3306/db?useSSL=true&requireSSL=true&verifyServerCertificate=true&trustCertificateKeyStoreUrl=file:/path/rds-ca-bundle.p12). Fix nhanh, zero-downtime, phù hợp DevOps.

  • Add explicit mappings between the Data Analysts' IP addresses and the instance in the security group assigned to the DB cluster. ❌
    Sai vì: Security group đã "allow from all corporate IP addresses" → bao quát Analysts (cùng mạng corporate qua Direct Connect). Vấn đề không phải network access mà là SSL handshake failure (lỗi ở layer 7 TLS, không phải layer 4 TCP). Thêm explicit IP chỉ dư thừa, không fix root cause.

  • Modify the Data Analysts' local client firewall to allow network traffic to AWS. ❌
    Sai vì: Firewall local chặn outbound traffic đến AWS endpoint sẽ gây lỗi connect timeout ngay từ đầu, nhưng Specialist đã verify username/password và security group → traffic đến DB OK (chỉ fail TLS). Vấn đề là client thiếu SSL cert, không phải firewall (thường AWS port 3306/5432 đã allow).

📘 Tài liệu tham khảo (cập nhật AWS 2024-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 connection string cụ thể, hỏi thêm nhé!

Câu 6
A company is concerned about the cost of a large-scale, transactional application using Amazon DynamoDB that only needs to store data for 2 days before it is deleted. In looking at the tables, a Database Specialist notices that much of the data is months old, and goes back to when the application was first deployed.
What can the Database Specialist do to reduce the overall cost?
  1. A Create a new attribute in each table to track the expiration time and create an AWS Glue transformation to delete entries more than 2 days old.
  2. B Create a new attribute in each table to track the expiration time and enable DynamoDB Streams on each table.
  3. C Create a new attribute in each table to track the expiration time and enable time to live (TTL) on each table.
  4. D Create an Amazon CloudWatch Events event to export the data to Amazon S3 daily using AWS Data Pipeline and then truncate the Amazon DynamoDB table.
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 vấn đề chi phí lưu trữ cao của một ứng dụng giao dịch lớn-scale sử dụng Amazon DynamoDB. Ứng dụng chỉ cần lưu dữ liệu trong 2 ngày trước khi xóa, nhưng Database Specialist phát hiện nhiều dữ liệu cũ (hàng tháng, từ lúc deploy đầu tiên) vẫn còn trong bảng. Mục tiêu là giảm chi phí tổng thể bằng cách xử lý dữ liệu hết hạn một cách hiệu quả, tự động và tiết kiệm.

🛠️ Bối cảnh kỹ thuật: DynamoDB tính phí dựa trên stored data size (dung lượng lưu trữ), read/write capacity units (RCU/WCU), và các tính năng bổ sung. Dữ liệu cũ làm tăng chi phí lưu trữ không cần thiết. Giải pháp cần tự động xóa dữ liệu mà không ảnh hưởng hiệu suất ứng dụng, phù hợp với kiến thức AWS cập nhật đến 2026 (DynamoDB TTL vẫn là tính năng core, hỗ trợ lên đến hàng tỷ items/ngày mà không tốn phí xử lý).

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

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

Đáp án đúng: Create a new attribute in each table to track the expiration time and enable time to live (TTL) on each table.

Lý do chi tiết 🏆:

  • TTL (Time to Live) là tính năng miễn phí của DynamoDB (cập nhật 2026), tự động xóa items sau thời gian chỉ định dựa trên attribute số (ví dụ: epoch timestamp + 2 ngày = 172800 giây).
  • Thêm attribute mới (như expirationTime) vào mỗi item khi viết dữ liệu, sau đó enable TTL trên attribute đó → DynamoDB backend tự xóa (thường trong 48h), giảm chi phí lưu trữ ngay lập tức mà không cần code custom hoặc service ngoài.
  • Hiệu quả cao cho large-scale: Xử lý hàng tỷ deletions/ngày, không ảnh hưởng throughput. Dữ liệu cũ sẽ được xóa dần sau khi enable.

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

  • Create a new attribute in each table to track the expiration time and create an AWS Glue transformation to delete entries more than 2 days old.
    ❌ Sai: AWS Glue là ETL service cho batch processing, không phù hợp real-time deletion. Tạo job Glue định kỳ scan/delete → tốn kém (Glue tính phí DPU-hour, scan toàn bộ table tốn RCU cao), phức tạp setup, không tự động real-time như TTL. Không giảm chi phí hiệu quả cho large-scale.

  • Create a new attribute in each table to track the expiration time and enable DynamoDB Streams on each table.
    ❌ Sai: DynamoDB Streams chỉ capture changes (insert/update/delete) để stream ra Lambda/Kinesis, không tự xóa dữ liệu. Enable Streams tốn thêm phí (~$0.02/100k read request units), phải viết Lambda custom để process stream và delete → overhead cao, không giải quyết gốc rễ, dễ miss items.

  • Create a new attribute in each table to track the expiration time and enable time to live (TTL) on each table.
    ✅ Đúng: Như giải thích trên. Giải pháp tối ưu nhất, native, zero-cost cho deletion, scale vô hạn. AWS khuyến nghị cho use-case "hot data short-lived".

  • Create an Amazon CloudWatch Events event to export the data to Amazon S3 daily using AWS Data Pipeline and then truncate the Amazon DynamoDB table.
    ❌ Sai: Data Pipeline (deprecated dần từ 2023, thay bằng DMS/SYNCTE) + CloudWatch Events → quá phức tạp và tốn kém (export phí, S3 storage, Pipeline DPU). Truncate table xóa toàn bộ, không selective (mất data <2 ngày). Không khả thi cho transactional app đang chạy, gây downtime/race condition.

🧠 Kết luận: TTL là best practice AWS cho cost-optimized TTL data. Implement ngay để dữ liệu cũ biến mất tự động! 🚀

Câu 7
A company has an on-premises system that tracks various database operations that occur over the lifetime of a database, including database shutdown, deletion, creation, and backup.
The company recently moved two databases to Amazon RDS and is looking at a solution that would satisfy these requirements. The data could be used by other systems within the company.
Which solution will meet these requirements with minimal effort?
  1. A Create an Amazon CloudWatch Events rule with the operations that need to be tracked on Amazon RDS. Create an AWS Lambda function to act on these rules and write the output to the tracking systems.
  2. B Create an AWS Lambda function to trigger on AWS CloudTrail API calls. Filter on specific RDS API calls and write the output to the tracking systems.
  3. C Create RDS event subscriptions. Have the tracking systems subscribe to specific RDS event system notifications.
  4. D Write RDS logs to Amazon Kinesis Data Firehose. Create an AWS Lambda function to act on these rules and write the output to the tracking systems.
Xem giải thích

🧩 Giải thích nội dung câu hỏi

Câu hỏi mô tả một công ty có hệ thống on-premises để theo dõi các hoạt động chính của database suốt vòng đời, bao gồm shutdown (tắt DB), deletion (xóa DB), creation (tạo DB) và backup (sao lưu). Gần đây, họ đã di chuyển hai database sang Amazon RDS (Relational Database Service) và cần một giải pháp tương tự để theo dõi các sự kiện này. Giải pháp phải:

  • Đáp ứng yêu cầu theo dõi các hoạt động trên.
  • Cho phép các hệ thống khác trong công ty sử dụng dữ liệu (tích hợp dễ dàng).
  • Minimal effort (nỗ lực tối thiểu, ưu tiên giải pháp native, đơn giản nhất của AWS).

Mục tiêu chính: Tìm giải pháp native của RDS để notify các sự kiện management (quản lý DB) mà không cần code phức tạp hay tích hợp nhiều dịch vụ. Đây là chủ đề thuộc RDS Events & Notifications trong AWS DevOps, giúp theo dõi trạng thái DB real-time với chi phí thấp. (📘 Tài liệu tham khảo: Amazon RDS User Guide - Events and Notifications - Cập nhật đến 2026, hỗ trợ RDS Multi-AZ, Aurora, v.v.).

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

Đáp án đúng: Create RDS event subscriptions. Have the tracking systems subscribe to specific RDS event system notifications.

Lý do:

  • RDS cung cấp Event Subscriptions native (không cần code thêm), cho phép subscribe trực tiếp đến hơn 60 loại event categories như DB instance creation, deletion, backup completion, shutdown, maintenance, failover, v.v. 🛠️
  • Tracking systems (hệ thống theo dõi) có thể subscribe qua SNS (Simple Notification Service) hoặc email/SMS, và dữ liệu event được gửi real-time, dễ integrate với hệ thống khác (API, Lambda, S3).
  • Minimal effort: Chỉ cần tạo subscription trong RDS Console/CLI (vài phút), không build Lambda hay rule phức tạp. Hoàn hảo cho migration từ on-premises.
  • Phù hợp yêu cầu "data could be used by other systems" vì SNS topic cho phép multiple subscribers.

📋 Phân tích chi tiết tất cả các phương án

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ân tích giải thích tại sao đúng/sai dựa trên best practices AWS DevOps 2026 (ưu tiên native, scalable, low-effort).

  • ❌ Phương án SAI: Create an Amazon CloudWatch Events rule with the operations that need to tracked on Amazon RDS. Create an AWS Lambda function to act on these rules and write the output to the tracking systems.
    Giải thích sai: CloudWatch Events (nay là EventBridge) có thể capture RDS events, nhưng yêu cầu tạo rule thủ công + Lambda để process và forward. Effort cao hơn native RDS Events (phải code Lambda, handle errors, permissions IAM phức tạp). Không phải giải pháp đơn giản nhất cho RDS-specific events. 🛠️ (EventBridge tốt cho multi-service, nhưng overkill ở đây).

  • ❌ Phương án SAI: Create an AWS Lambda function to trigger on AWS CloudTrail API calls. Filter on specific RDS API calls and write the output to the tracking systems.
    Giải thích sai: CloudTrail logs API calls (như CreateDBInstance, DeleteDBInstance), nhưng không capture non-API events như automatic shutdown, backup status, hoặc instance events (e.g., storage full). Phải parse logs thủ công trong Lambda (complex filtering), delay (logs ~15p), và effort cao (Kinesis/CloudWatch Logs integration). Không cover đầy đủ "lifetime operations" như yêu cầu. ❌

  • ✅ Phương án ĐÚNG: Create RDS event subscriptions. Have the tracking systems subscribe to specific RDS event system notifications.
    Giải thích đúng: Như đã nêu ở trên. Native RDS feature (DB event categories: configuration change, backup, deletion, low storage, shutdown, v.v.). Subscribe qua SNS/Email, real-time (<5 phút), zero code, scalable cho multiple DBs/systems. Minimal effort: Console wizard hỗ trợ filter source (DB instance ARN). Hoàn hảo cho DevOps monitoring post-migration. 🏆 (📘 Tài liệu: RDS Event Subscriptions).

  • ❌ Phương án SAI: Write RDS logs to Amazon Kinesis Data Firehose. Create an AWS Lambda function to act on these rules and write the output to the tracking systems.
    Giải thích sai: RDS logs (error log, slow query log, audit log) là operational logs (queries, errors), KHÔNG phải management events như creation/deletion/backup/shutdown. Firehose + Lambda dùng cho stream processing logs, nhưng không có event data cần theo dõi. Effort rất cao (enable logging, transformation), irrelevant cho yêu cầu. 🚫

Kết luận DevOps Pro: Chọn RDS Event Subscriptions là best practice vì native, real-time, low-cost (~$0.40/1k notifications). Scale dễ dàng với SNS fanout cho "other systems". Test ngay trên RDS Console! 🚀

Câu 8
A clothing company uses a custom ecommerce application and a PostgreSQL database to sell clothes to thousands of users from multiple countries. The company is migrating its application and database from its on-premises data center to the AWS Cloud. The company has selected Amazon EC2 for the application and Amazon RDS for PostgreSQL for the database. The company requires database passwords to be changed every 60 days. A Database Specialist needs to ensure that the credentials used by the web application to connect to the database are managed securely.
Which approach should the Database Specialist take to securely manage the database credentials?
  1. A Store the credentials in a text file in an Amazon S3 bucket. Restrict permissions on the bucket to the IAM role associated with the instance profile only. Modify the application to download the text file and retrieve the credentials on start up. Update the text file every 60 days.
  2. B Configure IAM database authentication for the application to connect to the database. Create an IAM user and map it to a separate database user for each ecommerce user. Require users to update their passwords every 60 days.
  3. C Store the credentials in AWS Secrets Manager. Restrict permissions on the secret to only the IAM role associated with the instance profile. Modify the application to retrieve the credentials from Secrets Manager on start up. Configure the rotation interval to 60 days.
  4. D Store the credentials in an encrypted text file in the application AMI. Use AWS KMS to store the key for decrypting the text file. Modify the application to decrypt the text file and retrieve the credentials on start up. Update the text file and publish a new AMI every 60 days.
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 việc migrate ứng dụng ecommerce và database PostgreSQL từ on-premises sang AWS Cloud. Công ty sử dụng Amazon EC2 cho ứng dụng web và Amazon RDS for PostgreSQL cho database, phục vụ hàng nghìn người dùng từ nhiều quốc gia. Yêu cầu chính là quản lý an toàn credentials (tên người dùng và mật khẩu database) mà ứng dụng web sử dụng để kết nối với RDS, với điều kiện bắt buộc thay đổi mật khẩu mỗi 60 ngày.

Database Specialist cần chọn phương pháp tốt nhất để:

  • Lưu trữ credentials an toàn (không expose trực tiếp).
  • Cho phép EC2 instance (qua IAM role) truy cập credentials.
  • Tự động hóa rotation (xoay mật khẩu) mỗi 60 ngày mà không làm gián đoạn ứng dụng.
  • Tuân thủ best practices AWS về security (least privilege, encryption, automation).

Vấn đề cốt lõi: Tránh hardcode credentials trong code/app, tránh manual update thủ công, thay vào đó dùng dịch vụ managed như Secrets Manager để retrieve động và rotate tự động. Đây là scenario điển hình trong AWS Well-Architected Framework - Security Pillar (cập nhật 2024-2026).

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

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

Đáp án đúng: Store the credentials in AWS Secrets Manager. Restrict permissions on the secret to only the IAM role associated with the instance profile. Modify the application to retrieve the credentials from Secrets Manager on start up. Configure the rotation interval to 60 days.

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

  • AWS Secrets Manager là dịch vụ managed chuyên dụng để lưu trữ, retrieve và tự động rotate secrets (bao gồm DB credentials) mà không cần lambda custom cho RDS PostgreSQL (tích hợp sẵn từ 2018, cập nhật 2025 với multi-region replication).
  • Restrict permissions qua IAM policy chỉ cho instance profile role của EC2 → least privilege principle.
  • App retrieve động lúc startup qua AWS SDK (ví dụ: boto3.get_secret_value()) → không lưu credentials local.
  • Rotation 60 ngày: Tự động generate mật khẩu mới, update vào RDS, test kết nối → zero-downtime, an toàn cao.
  • Tuân thủ compliance (PCI DSS, HIPAA) với encryption at-rest/transit (KMS-managed).

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

  • ❌ Phương án SAI: Store the credentials in a text file in an Amazon S3 bucket. Restrict permissions on the bucket to the IAM role associated with the instance profile only. Modify the application to download the text file and retrieve the credentials on start up. Update the text file every 60 days.
    Giải thích sai: Lưu text file plain-text trong S3 không an toàn (dù restrict IAM), dễ bị expose nếu bucket policy lỗi hoặc insider threat. Manual update 60 ngày → không scalable, dễ quên → rủi ro downtime hoặc security gap. Không hỗ trợ rotation tự động, vi phạm AWS security best practices (khuyến cáo dùng Secrets Manager thay thế).

  • ❌ Phương án SAI: Configure IAM database authentication for the application to connect to the database. Create an IAM user and map it to a separate database user for each ecommerce user. Require users to update their passwords every 60 days.
    Giải thích sai: IAM DB Authentication dùng token tạm thời (15 phút) thay password, phù hợp cho app connect DB nhưng KHÔNG hỗ trợ rotation password 60 ngày (vì không dùng password truyền thống). Tạo IAM user riêng cho mỗi ecommerce user → overkill & không khớp (app connect DB chung, không phải per-user auth). Phức tạp, không giải quyết yêu cầu password rotation cho app-DB connection.

  • ✅ Phương án ĐÚNG: Store the credentials in AWS Secrets Manager. Restrict permissions on the secret to only the IAM role associated with the instance profile. Modify the application to retrieve the credentials from Secrets Manager on start up. Configure the rotation interval to 60 days.
    Giải thích đúng: Như phần trên, đây là giải pháp chuẩn AWS (integration EC2 + RDS + Secrets Manager). Rotation lambda built-in tự động thay đổi password RDS, update secret, verify app connect → an toàn, tự động hóa cao. Hỗ trợ caching TTL để giảm API calls (cập nhật 2025).

  • ❌ Phương án SAI: Store the credentials in an encrypted text file in the application AMI. Use AWS KMS to store the key for decrypting the text file. Modify the application to decrypt the text file and retrieve the credentials on start up. Update the text file and publish a new AMI every 60 days.
    Giải thích sai: Encrypted AMI dùng KMS tốt hơn plain-text, nhưng manual republish AMI 60 ngày → tốn công, scale kém (deploy fleet EC2 lớn), downtime khi update. AMI bake-in secrets vẫn rủi ro (immutable sau build), không rotation tự động → không khuyến khích so với Secrets Manager dynamic.

Kết luận 🚀: Phương án Secrets Manager là best practice cho DevOps automation, giảm operational overhead và tăng security posture! Nếu implement, dùng AWS SDK trong app code để fetch secret.

Câu 9 Chọn nhiều đáp án
A financial services company is developing a shared data service that supports different applications from throughout the company. A Database Specialist designed a solution to leverage Amazon ElastiCache for Redis with cluster mode enabled to enhance performance and scalability. The cluster is configured to listen on port 6379.
Which combination of steps should the Database Specialist take to secure the cache data and protect it from unauthorized access? (Choose three.)
  1. A Enable in-transit and at-rest encryption on the ElastiCache cluster.
  2. B Ensure that Amazon CloudWatch metrics are configured in the ElastiCache cluster.
  3. C Ensure the security group for the ElastiCache cluster allows all inbound traffic from itself and inbound traffic on TCP port 6379 from trusted clients only.
  4. D Create an IAM policy to allow the application service roles to access all ElastiCache API actions.
  5. E Ensure the security group for the ElastiCache clients authorize inbound TCP port 6379 and port 22 traffic from the trusted ElastiCache cluster's security group.
  6. F Ensure the cluster is created with the auth-token parameter and that the parameter is used in all subsequent commands.
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 bảo mật dữ liệu cache trên Amazon ElastiCache for Redis trong chế độ cluster mode enabled (chế độ phân tán để tăng hiệu suất và khả năng mở rộng). Công ty tài chính đang xây dựng dịch vụ dữ liệu chia sẻ, cluster lắng nghe trên port 6379 (port mặc định của Redis).
Mục tiêu chính: Chọn BA bước kết hợp để bảo vệ dữ liệu cache khỏi truy cập trái phép, bao gồm mã hóa dữ liệu, kiểm soát truy cập mạng và xác thực.
Đây là câu hỏi kiểu multiple choice (chọn 3) thuộc chủ đề Security cho ElastiCache Redis trong kỳ thi AWS Certified DevOps Engineer Professional (DOP-C02, cập nhật 2024-2026). 🛡️

✅ Đáp án đúng (Chọn 3 phương án)

Các đáp án đúng là:

  1. Enable in-transit and at-rest encryption on the ElastiCache cluster.
  2. Ensure the security group for the ElastiCache cluster allows all inbound traffic from itself and inbound traffic on TCP port 6379 from trusted clients only.
  3. Ensure the cluster is created with the auth-token parameter and that the parameter is used in all subsequent commands.

Lý do lựa chọn:
Những bước này tạo lớp bảo mật toàn diện theo best practices AWS:

  • 🛡️ Mã hóa dữ liệu (in-transit/at-rest) ngăn chặn đánh cắp dữ liệu.
  • 🔒 Security Group kiểm soát truy cập mạng (chỉ trusted clients trên port 6379, và self-traffic cho cluster mode).
  • 🔑 Auth-token (password Redis) yêu cầu xác thực cho mọi lệnh, ngăn truy cập không xác thực.
    Kết hợp chúng bảo vệ dữ liệu tài chính nhạy cảm khỏi rò rỉ. Theo AWS Well-Architected Framework (Security Pillar, 2024). 📘

📋 Phân tích chi tiết từng phương án

Dưới đây là phân tích tất cả 6 phương án, giữ nguyên văn bản gốc tiếng Anh. Mỗi phương án được đánh giá ✅ (Đúng) hoặc ❌ (Sai), kèm giải thích bằng tiếng Việt dựa trên tài liệu AWS mới nhất (ElastiCache Redis 7.1+, cập nhật 2026).

  • ✅ Enable in-transit and at-rest encryption on the ElastiCache cluster.
    Giải thích đúng: Đây là bước bắt buộc để mã hóa dữ liệu trong quá trình truyền (TLS/SSL) và lưu trữ (AES-256). Trong cluster mode, bật encryption qua console/CLI khi tạo cluster (TransitEncryptionEnabled=true, AtRestEncryptionEnabled=true). Ngăn chặn MITM attacks và data leak. Best practice cho dữ liệu tài chính. 🛡️

  • ❌ Ensure that Amazon CloudWatch metrics are configured in the ElastiCache cluster.
    Giải thích sai: CloudWatch metrics chỉ dùng cho monitoring hiệu suất (CPU, memory, connections), không bảo mật dữ liệu hay truy cập. Không liên quan đến unauthorized access; chỉ giúp phát hiện anomaly sau khi xảy ra. Không phải bước bảo mật trực tiếp. 📊

  • ✅ Ensure the security group for the ElastiCache cluster allows all inbound traffic from itself and inbound traffic on TCP port 6379 from trusted clients only.
    Giải thích đúng: Security Group của ElastiCache cluster phải cho phép: (1) All traffic từ chính nó (self-referencing cho cluster mode replication), (2) TCP 6379 chỉ từ trusted clients (EC2/VPC endpoints). Nguyên tắc least privilege, tránh open-all. Cấu hình qua VPC Security Groups. 🔒

  • ❌ Create an IAM policy to allow the application service roles to allow the application service roles to access all ElastiCache API actions.
    Giải thích sai: IAM chỉ kiểm soát management APIs (tạo/xóa cluster), KHÔNG dùng cho data access (Redis commands). Data access dùng network (SG) + auth-token. Policy "all ElastiCache actions" quá rộng, vi phạm least privilege và không bảo vệ cache data. 🚫

  • ❌ Ensure the security group for the ElastiCache clients authorize inbound TCP port 6379 and port 22 traffic from the trusted ElastiCache cluster's security group.
    Giải thích sai: Hướng ngược: Clients (ứng dụng) là outbound đến ElastiCache (port 6379). ElastiCache KHÔNG cần kết nối inbound đến clients (không SSH port 22). SG của clients chỉ cần outbound 6379 đến ElastiCache SG. Sai logic one-way traffic. ↔️❌

  • ✅ Ensure the cluster is created with the auth-token parameter and that the parameter is used in all subsequent commands.
    Giải thích đúng: Auth-token là password Redis (bật qua TransitEncryptionEnabled + auth-token khi tạo cluster). Mọi client phải dùng AUTH <token> trước lệnh khác. Bắt buộc trong cluster mode để tránh unauthorized Redis commands. Rotate token định kỳ. 🔑

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

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

Câu 10
A company is running an Amazon RDS for PostgreSQL DB instance and wants to migrate it to an Amazon Aurora PostgreSQL DB cluster. The current database is 1 TB in size. The migration needs to have minimal downtime.
What is the FASTEST way to accomplish this?
  1. A Create an Aurora PostgreSQL DB cluster. Set up replication from the source RDS for PostgreSQL DB instance using AWS DMS to the target DB cluster.
  2. B Use the pg_dump and pg_restore utilities to extract and restore the RDS for PostgreSQL DB instance to the Aurora PostgreSQL DB cluster.
  3. C Create a database snapshot of the RDS for PostgreSQL DB instance and use this snapshot to create the Aurora PostgreSQL DB cluster.
  4. D Migrate data from the RDS for PostgreSQL DB instance to an Aurora PostgreSQL DB cluster using an Aurora Replica. Promote the replica during the cutover.
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 DB instance Amazon RDS for PostgreSQL có kích thước 1 TB sang Amazon Aurora PostgreSQL DB cluster, với yêu cầu downtime tối thiểu và cách nhanh nhất.

  • Bối cảnh: RDS PostgreSQL là engine truyền thống, trong khi Aurora PostgreSQL là phiên bản managed của PostgreSQL trên Aurora, mang lại hiệu suất cao hơn, scale tốt hơn và chi phí thấp hơn. Với kích thước lớn (1 TB), phương pháp migrate phải hỗ trợ replication liên tục để giảm thiểu thời gian gián đoạn (downtime), tránh dump toàn bộ dữ liệu gây chậm và downtime dài.
  • Mục tiêu chính: Tìm phương pháp nhanh nhất (fastest) đảm bảo minimal downtime, phù hợp với best practice AWS cho migration giữa RDS và Aurora cùng engine (PostgreSQL). AWS hỗ trợ native replication cho trường hợp này từ phiên bản mới nhất (Aurora PostgreSQL 15.x trở lên, cập nhật 2024-2026).
  • Thách thức: Không thể dùng snapshot trực tiếp vì format snapshot RDS và Aurora khác nhau; cần replication để sync dữ liệu real-time.

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

✅ Đáp án đúng

Migrate data from the RDS for PostgreSQL DB instance to an Aurora PostgreSQL DB cluster using an Aurora Replica. Promote the replica during the cutover.

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

  • Đây là phương pháp native và nhanh nhất của AWS cho migration RDS PostgreSQL → Aurora PostgreSQL. Bạn tạo một Aurora Replica từ RDS source (sử dụng binary log replication - logical replication cho Postgres), dữ liệu sync real-time với lag rất thấp (<1 phút cho 1TB). Sau khi sync hoàn tất, promote replica thành primary chỉ mất vài phút downtime (cutover).
  • Ưu điểm: Không cần tool bên ngoài, tự động handle schema/data, hỗ trợ multi-AZ, scale nhanh. Phù hợp kích thước lớn (1TB) mà không dump full.
  • Quy trình:
    1. Tạo Aurora cluster empty.
    2. Thêm RDS instance làm source replica cho Aurora (qua AWS Console/CLI).
    3. Monitor replication lag → Stop writes on source → Promote.
  • Cập nhật 2026: Hỗ trợ full Postgres 16 features trong Aurora 16.x.

❌ Phân tí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 tiếng Anh. Tôi đánh dấu ✅ Đúng hoặc ❌ Sai dựa trên tính khả thi, tốc độ và downtime.

  • ❌ [SAI] Create an Aurora PostgreSQL DB cluster. Set up replication from the source RDS for PostgreSQL DB instance using AWS DMS to the target DB cluster.
    Giải thích sai: AWS DMS (Database Migration Service) hỗ trợ replication, nhưng chậm hơn nhiều cho DB 1TB (cần full load + CDC, lag cao 30-60 phút), downtime dài hơn (cutover DMS phức tạp). DMS dùng cho heterogeneous migration, không phải fastest cho cùng engine. Không native, tốn tài nguyên, overhead cao. ❌ Không phải cách nhanh nhất.

  • ❌ [SAI] Use the pg_dump and pg_restore utilities to extract and restore the RDS for PostgreSQL DB instance to the Aurora PostgreSQL DB cluster.
    Giải thích sai: pg_dump/pg_restore là dump full database (text/binary), mất hàng giờ đến ngày cho 1TB (tốc độ ~100GB/giờ), downtime toàn bộ quá trình vì phải stop writes. Không hỗ trợ replication liên tục, chỉ one-time. Phù hợp DB nhỏ, không minimal downtime. ❌ Chậm và downtime lớn.

  • ❌ [SAI] Create a database snapshot of the RDS for PostgreSQL DB instance and use this snapshot to create the Aurora PostgreSQL DB cluster.
    Giải thích sai: Snapshot RDS PostgreSQL KHÔNG thể restore trực tiếp sang Aurora PostgreSQL vì format khác nhau (RDS dùng native Postgres snapshot, Aurora dùng proprietary storage). AWS không hỗ trợ cross-engine snapshot restore cho Postgres. Phải dùng DMS hoặc replica. ❌ Không khả thi về kỹ thuật.

  • ✅ [ĐÚNG] Migrate data from the RDS for PostgreSQL DB instance to an Aurora PostgreSQL DB cluster using an Aurora Replica. Promote the replica during the cutover.
    Giải thích đúng: Như phần trên, đây là best practice AWS với replication native, fastest cho large DB, downtime <5 phút. ✅ Hoàn hảo cho yêu cầu.

🛠️ Lời khuyên thực tế: Test trên staging trước, monitor CloudWatch ReplicationLag. Nếu DB có extension đặc biệt, kiểm tra compatibility Aurora PostgreSQL matrix (2026: hỗ trợ 100+ extensions).