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

Tìm thấy 358 câu.

Câu 151
A finance company needs to make sure that its MySQL database backups are available for the most recent 90 days. All of the MySQL databases are hosted on
Amazon RDS for MySQL DB instances. A database specialist must implement a solution that meets the backup retention requirement with the least possible development effort.
Which approach should the database specialist take?
  1. A Use AWS Backup to build a backup plan for the required retention period. Assign the DB instances to the backup plan.
  2. B Modify the DB instances to enable the automated backup option. Select the required backup retention period.
  3. C Automate a daily cron job on an Amazon EC2 instance to create MySQL dumps, transfer to Amazon S3, and implement an S3 Lifecycle policy to meet the retention requirement.
  4. D Use AWS Lambda to schedule a daily manual snapshot of the DB instances. Delete snapshots that exceed the retention requirement.
Xem giải thích

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

Câu hỏi xoay quanh yêu cầu backup cho các instance Amazon RDS for MySQL của một công ty tài chính. Họ cần giữ backup có sẵn trong 90 ngày gần nhất (recent 90 days), và giải pháp phải tối ưu hóa effort phát triển thấp nhất (least possible development effort).

  • Bối cảnh chính: RDS automated backups mặc định chỉ hỗ trợ retention tối đa 35 ngày (theo tài liệu AWS cập nhật 2024-2026), không đủ cho 90 ngày. Do đó, cần giải pháp mở rộng retention mà không phải tự code nhiều.
  • Mục tiêu: Database specialist phải chọn cách tự động hóa backup, quản lý retention, hỗ trợ RDS MySQL, và centralized, managed service để giảm công sức dev (không custom script).
  • Kiến thức AWS mới nhất (2026): AWS Backup là service managed, hỗ trợ RDS với retention linh hoạt lên đến 100 năm, copy snapshots cross-region/account, và tích hợp audit/compliance cho finance sector (SOC, PCI DSS).

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

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

Đáp án đúng: Use AWS Backup to build a backup plan for the required retention period. Assign the DB instances to the backup plan.

Lý do chi tiết 🛠️:

  • AWS Backup là service fully managed, cho phép tạo backup plan với retention chính xác 90 ngày (hoặc lâu hơn), hỗ trợ RDS MySQL đầy đủ (bao gồm point-in-time recovery).
  • Least development effort: Chỉ cần tạo plan qua console/CLI, assign DB instances vào resource assignment → tự động backup hàng ngày/continuous, vault-based storage, lifecycle tự động expire sau 90 ngày. Không code, không cron, không manual delete.
  • Ưu điểm cho finance: Centralized vault, cross-account copy, audit trail (CloudTrail), encryption KMS, và compliance-ready. Hỗ trợ 2026 features như Backup Insights cho monitoring.

📋 Giải thí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 tiếng Anh. Mỗi phương án được đánh giá ✅ (đúng) hoặc ❌ (sai), với lý do dựa trên AWS best practices 2026.

  • Use AWS Backup to build a backup plan for the required retention period. Assign the DB instances to the backup plan.
    ✅ Đúng hoàn toàn vì: Đây là giải pháp managed nhất, hỗ trợ retention 90 ngày+ cho RDS (vượt giới hạn 35 ngày của RDS native). Effort thấp: Tạo plan → assign resources → done. Tích hợp S3 vault, PITR, và auto-expire. Lý tưởng cho compliance finance.

  • Modify the DB instances to enable the automated backup option. Select the required backup retention period.
    ❌ Sai vì: RDS automated backups chỉ hỗ trợ tối đa 35 ngày retention (không thể set 90 ngày). Enable option này chỉ phù hợp short-term, không đáp ứng yêu cầu. Phải dùng manual snapshots hoặc AWS Backup để extend.

  • Automate a daily cron job on an Amazon EC2 instance to create MySQL dumps, transfer to Amazon S3, and implement an S3 Lifecycle policy to meet the retention requirement.
    ❌ Sai vì: High development effort (phải code mysqldump script, cron setup, error handling, IAM roles). Không native PITR như RDS snapshots, dumps không consistent cho large DB, tốn chi phí EC2 liên tục. Không phải "least effort" – vi phạm yêu cầu chính.

  • Use AWS Lambda to schedule a daily manual snapshot of the DB instances. Delete snapshots that exceed the retention requirement.
    ❌ Sai vì: Manual snapshots qua Lambda cần custom code (RDS API calls, logic delete old snaps via tag/filter), schedule EventBridge, error-prone (throttle limits, consistency). Effort cao hơn AWS Backup (phải dev/maintain Lambda), không continuous backup, thiếu centralized management.

🏆 Kết luận & Best Practices

Giải pháp AWS Backup là optimal choice cho RDS long-term retention với zero custom dev. Nếu scale lớn, kết hợp với AWS Backup Audit Manager cho finance compliance. Recommend test qua AWS Free Tier! 🚀

Câu 152 Chọn nhiều đáp án
An online advertising company uses an Amazon DynamoDb table as its data store. The table has Amazon DynamoDB Streams enabled and has a global secondary index on one of the keys. The table is encrypted using an AWS Key Management Service (AWS KMS) customer managed key.
The company has decided to expand its operations globally and wants to replicate the database in a different AWS Region by using DynamoDB global tables.
Upon review, an administrator notices the following:
✑ No role with the dynamodb: CreateGlobalTable permission exists in the account.
✑ An empty table with the same name exists in the new Region where replication is desired.
✑ A global secondary index with the same partition key but a different sort key exists in the new Region where replication is desired.
Which configurations will block the creation of a global table or the creation of a replica in the new Region? (Choose two.)
  1. A A global secondary index with the same partition key but a different sort key exists in the new Region where replication is desired.
  2. B An empty table with the same name exists in the Region where replication is desired.
  3. C No role with the dynamodb:CreateGlobalTable permission exists in the account.
  4. D DynamoDB Streams is enabled for the table.
  5. E The table is encrypted using a KMS customer managed key.
Xem giải thích

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

Câu hỏi thuộc chủ đề DynamoDB Global Tables trong AWS, tập trung vào các yêu cầu và hạn chế khi thiết lập replication đa vùng (multi-region replication) cho một bảng DynamoDB hiện có.

Nội dung chính của câu hỏi 📘:
Một công ty quảng cáo trực tuyến sử dụng bảng DynamoDB với DynamoDB Streams được bật, có Global Secondary Index (GSI) trên một khóa, và mã hóa bằng AWS KMS customer managed key (CMK). Họ muốn mở rộng toàn cầu bằng DynamoDB Global Tables (phiên bản v2 - hiện tại đến 2026), tức là thêm replica ở một AWS Region mới.

Quản trị viên phát hiện các vấn đề sau:
✑ Không có IAM role nào có quyền dynamodb:CreateGlobalTable.
✑ Có một bảng rỗng (empty table) cùng tên ở Region mới.
✑ Có GSI cùng partition key nhưng sort key khác ở Region mới.

Câu hỏi yêu cầu chọn TWO configurations 🛠️ sẽ chặn (block) việc tạo Global Table hoặc tạo replica ở Region mới.

Mục tiêu chính: Kiểm tra kiến thức về prerequisites của API CreateGlobalTable, schema consistency, IAM permissions, và các hạn chế khi thêm replica (theo docs AWS cập nhật 2024-2026). Global Tables yêu cầu: bảng nguồn tồn tại, target region KHÔNG có bảng cùng tên, schema (bao gồm GSI) identical, IAM permission đầy đủ, và hỗ trợ Streams/KMS nếu cấu hình đúng.

✅ Đáp án đúng (Chọn TWO)

Các configurations chặn việc tạo là:

  1. An empty table with the same name exists in the Region where replication is desired.
  2. No role with the dynamodb:CreateGlobalTable permission exists in the account.

Lý do lựa chọn 🏆:

  • API CreateGlobalTable bắt buộc IAM policy với action dynamodb:CreateGlobalTable để khởi tạo Global Table từ bảng hiện có. Không có role/permission → lỗi ngay lập tức.
  • AWS KHÔNG cho phép tạo replica nếu target region đã tồn tại bảng cùng tên (dù empty, chỉ 0 items). Docs rõ: "The destination AWS Region must not already contain a table with the same name." Empty table vẫn là "existing table" → conflict namespace → block. Phải xóa bảng target trước.

📋 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 text gốc tiếng Anh, kèm giải thích hoàn toàn bằng tiếng Việt với lý do đúng/sai dựa trên docs AWS mới nhất (Global Tables v2). Sử dụng ✅ cho đúng (block), ❌ cho sai (không block).

  • A global secondary index with the same partition key but a different sort key exists in the new Region where replication is desired.
    ❌ SAI - Không block độc lập. Lý do: Blocker chính là sự tồn tại của bảng empty cùng tên (đã liệt kê riêng). Khi chạy CreateGlobalTable, AWS tự tạo replica mới ở target với schema identical (bao gồm GSI partition/sort key giống hệt nguồn). GSI khác ở bảng target chỉ là "red herring" (thông tin đánh lạc hướng); nếu không có bảng target, AWS ignore và tạo đúng schema. Không ảnh hưởng nếu bảng target đã block.

  • An empty table with the same name exists in the Region where replication is desired.
    ✅ ĐÚNG - Block trực tiếp. Lý do: AWS cấm tạo replica nếu target region có bảng cùng tên (empty hay không). Phải xóa bảng target trước rồi mới add replica. Empty table vẫn occupy namespace → lỗi "TableAlreadyExistsException".

  • No role with the dynamodb:CreateGlobalTable permission exists in the account.
    ✅ ĐÚNG - Block quyền thực thi. Lý do: API CreateGlobalTable yêu cầu explicit IAM permission dynamodb:CreateGlobalTable (resource-level hoặc "*"). Không có role/policy phù hợp → AccessDeniedException ngay khi invoke.

  • DynamoDB Streams is enabled for the table.
    ❌ SAI - Không block, thậm chí hỗ trợ. Lý do: Global Tables tự động replicate Streams (point-in-time recovery). Streams enabled trên nguồn → replica tự enable matching Streams. Hoàn toàn compatible (docs xác nhận).

  • The table is encrypted using a KMS customer managed key.
    ❌ SAI - Không block nếu setup đúng. Lý do: Global Tables v2 hỗ trợ full KMS CMK multi-region. AWS replicate dữ liệu encrypted; chỉ cần CMK tương ứng ở target region (với key policy cho phép cross-account/region nếu cần). Không đề cập vấn đề key → không block, chỉ cần config thêm.

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

Lời khuyên thực hành 🚀: Trước khi tạo, dùng AWS CLI aws dynamodb describe-table --table-name <name> --region <target> kiểm tra empty/exists, và attach policy IAM đúng. Test ở sandbox để tránh downtime!

Câu 153
A large automobile company is migrating the database of a critical financial application to Amazon DynamoDB. The company's risk and compliance policy requires that every change in the database be recorded as a log entry for audits. The system is anticipating more than 500,000 log entries each minute. Log entries should be stored in batches of at least 100,000 records in each file in Apache Parquet format.
How should a database specialist implement these requirements with DynamoDB?
  1. A Enable Amazon DynamoDB Streams on the table. Create an AWS Lambda function triggered by the stream. Write the log entries to an Amazon S3 object.
  2. B Create a backup plan in AWS Backup to back up the DynamoDB table once a day. Create an AWS Lambda function that restores the backup in another table and compares both tables for changes. Generate the log entries and write them to an Amazon S3 object.
  3. C Enable AWS CloudTrail logs on the table. Create an AWS Lambda function that reads the log files once an hour and filters DynamoDB API actions. Write the filtered log files to Amazon S3.
  4. D Enable Amazon DynamoDB Streams on the table. Create an AWS Lambda function triggered by the stream. Write the log entries to an Amazon Kinesis Data Firehose delivery stream with buffering and Amazon S3 as the destination.
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 ô tô lớn đang di chuyển cơ sở dữ liệu của ứng dụng tài chính quan trọng sang Amazon DynamoDB. Chính sách rủi ro và tuân thủ của công ty yêu cầu ghi lại mọi thay đổi trong cơ sở dữ liệu dưới dạng log entry để kiểm toán. Hệ thống dự kiến hơn 500.000 log entries mỗi phút, và các log phải được lưu trữ theo batch ít nhất 100.000 records trong mỗi file định dạng Apache Parquet.

Mục tiêu là triển khai giải pháp với DynamoDB để đáp ứng yêu cầu real-time logging, high throughput (cao tải), batching lớn và định dạng Parquet trên Amazon S3. Giải pháp cần scale tốt, batch dữ liệu hiệu quả và tích hợp mượt mà với các dịch vụ AWS (dựa trên tài liệu AWS mới nhất đến 2026, DynamoDB Streams hỗ trợ stream changes real-time lên đến hàng triệu events/giây, kết hợp Kinesis Data Firehose v2 với buffering động và Parquet compression).

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

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

Enable Amazon DynamoDB Streams on the table. Create an AWS Lambda function triggered by the stream. Write the log entries to an Amazon Kinesis Data Firehose delivery stream with buffering and Amazon S3 as the destination.

🛠️ Lý do chọn (chi tiết):

  • DynamoDB Streams capture mọi thay đổi item-level (insert/update/delete) real-time với độ trễ <2 giây, phù hợp audits.
  • Lambda trigger bởi Streams để format log entries (e.g., JSON → Parquet payload).
  • Kinesis Data Firehose nhận data từ Lambda, buffer theo batch ≥100.000 records (cấu hình buffer size 50-128MB hoặc 100-900s), tự động convert sang Parquet (compression cao, columnar format lý tưởng audits), và deliver trực tiếp đến S3 với partitioning (e.g., by date/hour).
  • Scale hoàn hảo cho >500k entries/phút (Firehose xử lý hàng TB/giờ), chi phí thấp (~$0.029/GB ingested), không mất data nhờ retry/error queue.
  • Đây là best practice AWS cho high-volume change data capture (CDC) → Parquet on S3 (xác nhận AWS Well-Architected Framework 2025).

🔍 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. Tôi giữ nguyên văn bản gốc tiếng Anh của phương án, đánh dấu ✅ Đúng hoặc ❌ Sai, và giải thích lý do bằng tiếng Việt rõ ràng.

  • Enable Amazon DynamoDB Streams on the table. Create an AWS Lambda function triggered by the stream. Write the log entries to an Amazon S3 object.
    ❌ Sai vì: Streams + Lambda đúng về capture real-time, nhưng write trực tiếp đến S3 object không hỗ trợ batching 100k records/file tự động. Lambda invoke riêng lẻ cho từng shard (max 1MB/event), dẫn đến nhiều file nhỏ (không đạt yêu cầu batch), khó scale 500k/phút (throttling), và không convert Parquet tự động (phải code thủ công phức tạp). Không hiệu quả cho high-volume.

  • Create a backup plan in AWS Backup to back up the DynamoDB table once a day. Create an AWS Lambda function that restores the backup in another table and compares both tables for changes. Generate the log entries and write them to an Amazon S3 object.
    ❌ Sai vì: Backup daily chỉ snapshot point-in-time (PITR), không capture real-time changes và bỏ lỡ intra-day modifications (vi phạm audits "every change"). Restore + compare tốn kém (chi phí PITR $0.20/GB/tháng), chậm (giờ để restore), và không batch Parquet hay scale cho 500k/phút. Không phù hợp critical financial app cần low-latency logging.

  • Enable AWS CloudTrail logs on the table. Create an AWS Lambda function that reads the log files once an hour and filters DynamoDB API actions. Write the filtered log files to Amazon S3.
    ❌ Sai vì: CloudTrail chỉ log API calls (management/data-plane actions như PutItem), không capture item-level data changes (e.g., giá trị mới/cũ), thiếu chi tiết cho audits. Hourly polling không real-time (delay lớn), không batch 100k Parquet, và volume CloudTrail thấp (không scale 500k/phút data changes). Sai hoàn toàn với yêu cầu database changes.

Giải pháp đúng là kết hợp Streams + Lambda + Firehose để đảm bảo tuân thủ, scale và tối ưu chi phí! 🚀 Nếu cần code sample hoặc architecture diagram, hãy hỏi thêm nhé!

Câu 154
A company released a mobile game that quickly grew to 10 million daily active users in North America. The game's backend is hosted on AWS and makes extensive use of an Amazon DynamoDB table that is configured with a TTL attribute.
When an item is added or updated, its TTL is set to the current epoch time plus 600 seconds. The game logic relies on old data being purged so that it can calculate rewards points accurately. Occasionally, items are read from the table that are several hours past their TTL expiry.
How should a database specialist fix this issue?
  1. A Use a client library that supports the TTL functionality for DynamoDB.
  2. B Include a query filter expression to ignore items with an expired TTL.
  3. C Set the ConsistentRead parameter to true when querying the table.
  4. D Create a local secondary index on the TTL attribute.
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 một công ty phát hành game di động với 10 triệu người dùng hoạt động hàng ngày tại Bắc Mỹ. Backend game được host trên AWS, sử dụng bảng Amazon DynamoDB với thuộc tính TTL (Time to Live) được cấu hình.

  • Cơ chế TTL: Khi item được thêm hoặc cập nhật, TTL được set bằng thời gian epoch hiện tại + 600 giây (10 phút). Logic game phụ thuộc vào việc xóa dữ liệu cũ để tính điểm thưởng chính xác.
  • Vấn đề: Thỉnh thoảng, vẫn đọc được các item đã hết hạn TTL nhiều giờ (several hours past expiry).
  • Nguyên nhân gốc rễ 🛠️: TTL trong DynamoDB là eventual consistency deletion – DynamoDB chỉ đánh dấu item hết hạn và xóa background process (có thể mất đến 48 giờ theo tài liệu AWS mới nhất 2026). Item vẫn có thể đọc được ngay cả sau TTL expiry cho đến khi quá trình xóa hoàn tất.
  • Yêu cầu: Database specialist cần fix để tránh đọc dữ liệu cũ, đảm bảo logic game chính xác mà không ảnh hưởng hiệu suất (với quy mô lớn 10M users).

Mục tiêu: Tìm cách lọc bỏ item expired tại thời điểm query, không chờ xóa tự động.

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

Đáp án đúng: Include a query filter expression to ignore items with an expired TTL.

Lý do 🏆:

  • Filter expression cho phép lọc động trong Query/Scan operation, kiểm tra TTL < current epoch time (ví dụ: attribute_not_exists(TTL) OR TTL > :now).
  • Điều này bỏ qua item expired ngay lập tức tại client side, không phụ thuộc vào eventual deletion của DynamoDB.
  • Hiệu quả cao với throughput lớn, không tốn thêm chi phí index hay thay đổi cấu trúc bảng. Phù hợp best practice AWS cho ứng dụng real-time như game (DynamoDB Developer Guide 2026).

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

  • ✅ [ĐÚNG] Include a query filter expression to ignore items with an expired TTL.
    🧠 Giải thích đúng: Như trên, filter expression (sử dụng ConditionExpression hoặc FilterExpression) so sánh TTL với thời gian hiện tại, loại bỏ item expired trước khi trả về kết quả. Đây là cách chính xác và hiệu suất nhất, tránh đọc dữ liệu cũ. Ví dụ code: FilterExpression: 'TTL > :currentTime'.

  • ❌ [SAI] Use a client library that supports the TTL functionality for DynamoDB.
    🧠 Giải thích sai: Client library (như AWS SDKs) hỗ trợ ghi TTL khi put/update item, nhưng không tự động lọc khi read. Vấn đề vẫn tồn tại vì deletion eventual – library không giải quyết việc đọc item expired. Chỉ hỗ trợ ghi, không phải read filtering.

  • ❌ [SAI] Set the ConsistentRead parameter to true when querying the table.
    🧠 Giải thích sai: ConsistentRead=true chỉ đảm bảo strongly consistent read (dữ liệu mới nhất từ ít nhất 2 replicas), so với eventually consistent (rẻ hơn, nhanh hơn). Không liên quan đến TTL deletion – item expired vẫn tồn tại và có thể đọc được dù consistent hay không.

  • ❌ [SAI] Create a local secondary index on the TTL attribute.
    🧠 Giải thích sai: DynamoDB không hỗ trợ index trên TTL attribute (theo spec 2026, TTL là system-managed, không dùng làm sort/projection key). LSI cần sort key, nhưng tạo index trên TTL vô ích vì không query theo TTL trực tiếp và vẫn không lọc expired real-time.

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

  • DynamoDB Developer Guide: Time to Live (TTL) – Xác nhận deletion up to 48 hours, khuyên dùng filter cho app logic.
  • Best Practices: Query/Filter Expressions – Hướng dẫn lọc TTL expired.
  • Exam Topic DOP-C02: DynamoDB optimization cho high-scale apps (game workloads).
  • AWS re:Post & Blogs: Nhiều case study game (như Roblox) dùng filter TTL để tránh stale data.

💡 Lời khuyên DevOps: Kết hợp TTL + filter để tiết kiệm chi phí (xóa tự động) và đảm bảo tính chính xác logic. Test với Load Testing (Artillery/Locust) cho 10M users! 🚀

Câu 155
A development team at an international gaming company is experimenting with Amazon DynamoDB to store in-game events for three mobile games. The most popular game hosts a maximum of 500,000 concurrent users, and the least popular game hosts a maximum of 10,000 concurrent users. The average size of an event is 20 KB, and the average user session produces one event each second. Each event is tagged with a time in milliseconds and a globally unique identifier.
The lead developer created a single DynamoDB table for the events with the following schema:
✑ Partition key: game name
✑ Sort key: event identifier
✑ Local secondary index: player identifier
✑ Event time
The tests were successful in a small-scale development environment. However, when deployed to production, new events stopped being added to the table and the logs show DynamoDB failures with the ItemCollectionSizeLimitExceededException error code.
Which design change should a database specialist recommend to the development team?
  1. A Use the player identifier as the partition key. Use the event time as the sort key. Add a global secondary index with the game name as the partition key and the event time as the sort key.
  2. B Create two tables. Use the game name as the partition key in both tables. Use the event time as the sort key for the first table. Use the player identifier as the sort key for the second table.
  3. C Replace the sort key with a compound value consisting of the player identifier collated with the event time, separated by a dash. Add a local secondary index with the player identifier as the sort key.
  4. D Create one table for each game. Use the player identifier as the partition key. Use the event time as the sort key.
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 đội ngũ phát triển tại công ty game quốc tế đang thử nghiệm Amazon DynamoDB để lưu trữ sự kiện in-game (events) cho ba trò chơi di động.

  • Trò chơi phổ biến nhất: tối đa 500.000 người dùng đồng thời (concurrent users).
  • Trò chơi ít phổ biến nhất: tối đa 10.000 người dùng đồng thời.
  • Mỗi sự kiện trung bình 20 KB, và mỗi phiên người dùng tạo 1 event mỗi giây.
  • Mỗi event được gắn thời gian milliseconds và UUID toàn cầu.

Schema DynamoDB hiện tại (bảng duy nhất):

  • Partition key: game name (tên trò chơi).
  • Sort key: event identifier (UUID của event).
  • Local Secondary Index (LSI): player identifier (ID người chơi) + Event time (thời gian event).

Vấn đề xảy ra: Test nhỏ lẻ thành công ở môi trường dev, nhưng khi deploy production, không thêm event mới được, logs báo lỗi ItemCollectionSizeLimitExceededException.

🛠️ Nguyên nhân gốc rễ:

  • Với partition key = "game name" (chỉ 3 partitions cho 3 games), trò chơi phổ biến tạo 500.000 events/giây → partition "hot" (game phổ biến) nhanh chóng vượt giới hạn 10 GB/item collection của DynamoDB (mỗi partition chỉ chứa tối đa ~10 GB dữ liệu).
  • Lỗi ItemCollectionSizeLimitExceededException chính xác chỉ ra partition quá tải kích thước (theo AWS docs, giới hạn này không thay đổi đến 2026).
  • Throughput cũng bị ảnh hưởng do hot partition, nhưng lỗi chính là size limit.

Mục tiêu: Đề xuất thay đổi thiết kế để khắc phục, đảm bảo scalability cho production với workload cao.

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

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

Đáp án đúng: D - Create one table for each game. Use the player identifier as the partition key. Use the event time as the sort key.

Lý do:

  • Tạo 1 table riêng cho mỗi game → tránh hot partition giữa các games (3 tables độc lập).
  • Partition key = player identifier: Với 500k users/game, dữ liệu phân tán đều qua hàng trăm nghìn partitions (mỗi player một partition), tránh vượt 10 GB/partition. Events của cùng player được gom vào một partition, dễ query theo player.
  • Sort key = event time: Cho phép query events theo thời gian (range queries hiệu quả), phù hợp với timestamp milliseconds + UUID.
  • Giải quyết hoàn hảo lỗi ItemCollectionSizeLimitExceededException, đồng thời hỗ trợ high throughput (DynamoDB auto-scales partitions).
  • Chi phí thấp vì 3 tables nhỏ, dễ manage (on-demand capacity mode khuyến nghị).

🔍 Giải thích tất cả các phương án (A, B, C, D)

  • ❌ Phương án A (SAI): Use the player identifier as the partition key. Use the event time as the sort key. Add a global secondary index with the game name as the partition key and the event time as the sort key.

    • Lý do sai: Dùng player ID làm partition key tốt cho phân tán (như D), nhưng GSI với game name làm partition key sẽ tạo hot partition mới cho game phổ biến (500k events/giây đổ vào 1 GSI partition → vẫn vượt 10 GB). GSI tốn RCU/WCU thêm, không giải quyết gốc rễ hot game.
  • ❌ Phương án B (SAI): Create two tables. Use the game name as the partition key in both tables. Use the event time as the sort key for the first table. Use the player identifier as the sort key for the second table.

    • Lý do sai: Vẫn giữ game name làm partition key ở cả 2 tables → partition hot cho game phổ biến vẫn tồn tại (table 1: events theo time, table 2: theo player nhưng vẫn partition theo game). Tạo 2 tables/game làm phức tạp ứng dụng (duplicate data?), không phân tán đủ, vẫn lỗi size limit.
  • ❌ Phương án C (SAI): Replace the sort key with a compound value consisting of the player identifier collated with the event time, separated by a dash. Add a local secondary index with the player identifier as the sort key.

    • Lý do sai: Partition key vẫn là game name → hot partition không đổi. Sort key compound (player#time) chỉ giúp query trong partition, nhưng LSI giới hạn 10 GB/partition như primary (vẫn exceed). Không giải quyết gốc rễ, chỉ "vá víu" query patterns.
  • ✅ Phương án D (ĐÚNG): Create one table for each game. Use the player identifier as the partition key. Use the event time as the sort key.

    • Lý do đúng: Như đã giải thích ở trên – phân tán hoàn hảo theo player/game, tránh hot partitions, hỗ trợ queries hiệu quả (player + time range), scalable đến 500k users. Tuân thủ DynamoDB best practices 2026 (single-table design per logical group).

🛠️ Khuyến nghị bổ sung: Sử dụng On-Demand capacity cho tables, enable DynamoDB Streams nếu cần CDC, và monitor qua CloudWatch (PartitionMetrics). Test với DynamoDB Local trước production!

Câu 156 Chọn nhiều đáp án
An ecommerce company recently migrated one of its SQL Server databases to an Amazon RDS for SQL Server Enterprise Edition DB instance. The company expects a spike in read traffic due to an upcoming sale. A database specialist must create a read replica of the DB instance to serve the anticipated read traffic.
Which actions should the database specialist take before creating the read replica? (Choose two.)
  1. A Identify a potential downtime window and stop the application calls to the source DB instance.
  2. B Ensure that automatic backups are enabled for the source DB instance.
  3. C Ensure that the source DB instance is a Multi-AZ deployment with Always ON Availability Groups.
  4. D Ensure that the source DB instance is a Multi-AZ deployment with SQL Server Database Mirroring (DBM).
  5. E Modify the read replica parameter group setting and set the value to 1.
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 quy trình chuẩn bị tạo read replica cho một Amazon RDS for SQL Server Enterprise Edition DB instance trong bối cảnh một công ty ecommerce dự kiến tăng mạnh traffic đọc (read traffic) do sự kiện sale sắp tới.

  • Bối cảnh chính: Database đã được migrate từ SQL Server on-premises sang RDS SQL Server Enterprise Edition. Read replica giúp offload read queries từ primary DB instance (source) sang replica, tăng khả năng scale read traffic mà không ảnh hưởng đến write operations.
  • Yêu cầu: Database specialist cần thực hiện hai actions cụ thể trước khi tạo read replica để đảm bảo quá trình thành công.
  • Lưu ý kỹ thuật AWS (cập nhật đến 2026): Với RDS SQL Server Enterprise Edition, read replicas chỉ hỗ trợ qua native backup/restore và asynchronous replication, nhưng yêu cầu nghiêm ngặt về cấu hình Multi-AZ và backups. Không hỗ trợ cross-region replicas cho SQL Server ở một số trường hợp, và quá trình tạo replica không gây downtime cho source DB.

✅ Đáp án đúng (Chọn TWO)

Hai lựa chọn đúng là:

  • Ensure that automatic backups are enabled for the source DB instance.
    Lý do: RDS yêu cầu automatic backups phải được bật (với retention period ≥1 ngày) trên source DB instance trước khi tạo read replica. Điều này cho phép RDS sử dụng snapshots để khởi tạo replica ban đầu và hỗ trợ continuous replication. Nếu không bật, lệnh tạo replica sẽ thất bại ngay lập tức. 🛡️

  • Ensure that the source DB instance is a Multi-AZ deployment with Always ON Availability Groups.
    Lý do: Đối với SQL Server Enterprise Edition trên RDS, read replicas bắt buộc source phải là Multi-AZ DB cluster sử dụng Always On Availability Groups (AGs). AGs cung cấp high availability và là nền tảng để replicate dữ liệu asynchronously sang read replica. Nếu không phải Multi-AZ AGs, RDS không cho phép tạo replica. 🔥

📋 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 một cách đầy đủ, giữ nguyên nội dung gốc bằng tiếng Anh. Mỗi phương án được đánh dấu ✅ (đúng) hoặc ❌ (sai), kèm giải thích rõ ràng dựa trên tài liệu AWS RDS SQL Server (phiên bản mới nhất 2026).

  • ❌ Identify a potential downtime window and stop the application calls to the source DB instance.
    Giải thích sai: Việc tạo read replica trên RDS không gây downtime cho source DB instance. RDS xử lý quá trình khởi tạo replica bằng cách sử dụng snapshot và replication asynchronous mà ứng dụng có thể tiếp tục chạy bình thường trên source. Không cần dừng app hoặc lên lịch downtime – đây là ưu điểm lớn của RDS read replicas so với on-premises. Nếu làm vậy, sẽ gây gián đoạn không cần thiết! 🚫

  • ✅ Ensure that automatic backups are enabled for the source DB instance.
    Giải thích đúng: Như đã nêu ở phần đáp án, automatic backups là điều kiện tiên quyết. RDS kiểm tra tính năng này trước khi cho phép tạo replica. Nếu retention period = 0, bạn phải modify DB instance để bật backups (thông qua console/CLI/API). Điều này áp dụng cho tất cả engine hỗ trợ read replicas, bao gồm SQL Server EE. 📈

  • ✅ Ensure that the source DB instance is a Multi-AZ deployment with Always ON Availability Groups.
    Giải thích đúng: Yêu cầu bắt buộc cho SQL Server Enterprise Edition. Source phải là Multi-AZ với Always On AGs để kích hoạt replication cho read replicas. RDS tự động quản lý AGs ở backend, và chỉ Enterprise Edition hỗ trợ tính năng này (Standard Edition dùng Mirroring nhưng không hỗ trợ read replicas). Không có AGs → Không tạo được replica! 🏗️

  • ❌ Ensure that the source DB instance is a Multi-AZ deployment with SQL Server Database Mirroring (DBM).
    Giải thích sai: Database Mirroring (DBM) chỉ dành cho SQL Server Standard Edition và không hỗ trợ read replicas trên RDS. Với Enterprise Edition, phải dùng Always On AGs thay vì DBM. DBM chỉ dùng cho failover/high availability cơ bản, không cho read scaling. Lựa chọn này nhầm lẫn giữa hai tính năng! ❌

  • ❌ Modify the read replica parameter group setting and set the value to 1.
    Giải thích sai: Không có parameter group setting nào tên như vậy liên quan đến read replica trên RDS SQL Server. Có thể nhầm với rds.max_connections hoặc các param khác, nhưng không cần modify trước khi tạo replica. Parameter groups được apply sau khi tạo replica nếu cần, và không có giá trị "1" cụ thể cho việc kích hoạt replica. Đây là lựa chọn "bẫy" kỹ thuật! 🕳️

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

  • AWS RDS Documentation - Read Replicas for SQL Server: Read replicas for Microsoft SQL Server – Chi tiết yêu cầu Multi-AZ AGs và automatic backups.
  • Creating a read replica: Creating a read replica – Xác nhận prerequisites: backups enabled, Multi-AZ for SQL EE.
  • RDS SQL Server Best Practices: SQL Server on RDS – Phân biệt AGs vs. Mirroring.
  • AWS re:Post & Exam Prep: Các case study DOP-C02 (DevOps Professional) thường test prerequisites này.

Hy vọng phân tích giúp bạn nắm vững! Nếu cần lab thực hành trên AWS Console, hãy cho biết nhé. 🚀

Câu 157 Chọn nhiều đáp án
A company is running a two-tier ecommerce application in one AWS account. The application is backed by an Amazon RDS for MySQL Multi-AZ DB instance. A developer mistakenly deleted the DB instance in the production environment. The company restores the database, but this event results in hours of downtime and lost revenue.
Which combination of changes would minimize the risk of this mistake occurring in the future? (Choose three.)
  1. A Grant least privilege to groups, IAM users, and roles.
  2. B Allow all users to restore a database from a backup.
  3. C Enable deletion protection on existing production DB instances.
  4. D Use an ACL policy to restrict users from DB instance deletion.
  5. E Enable AWS CloudTrail logging and Enhanced Monitoring.
Xem giải thích

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

Câu hỏi mô tả một tình huống thực tế trong môi trường AWS: Một công ty đang chạy ứng dụng thương mại điện tử hai tầng (two-tier ecommerce) trên một tài khoản AWS duy nhất, sử dụng Amazon RDS for MySQL Multi-AZ DB instance làm cơ sở dữ liệu chính. Một lập trình viên (developer) đã xóa nhầm DB instance trong môi trường production, dẫn đến phải khôi phục từ backup nhưng gây ra hàng giờ downtime và mất doanh thu.

📌 Mục tiêu câu hỏi: Tìm kết hợp 3 thay đổi (combination of changes) để giảm thiểu rủi ro lặp lại sai lầm này trong tương lai. Đây là chủ đề liên quan đến bảo mật IAM (Identity and Access Management), bảo vệ tài nguyên RDS, và best practices DevOps để tránh xóa ngẫu nhiên (accidental deletion). Theo kiến thức AWS cập nhật đến 2026, RDS hỗ trợ các tính năng như deletion protection (từ năm 2019, vẫn là chuẩn), IAM least privilege, và resource-based policies để kiểm soát hành động delete.

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

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

  1. Grant least privilege to groups, IAM users, and roles.
  2. Enable deletion protection on existing production DB instances.
  3. Use an ACL policy to restrict users from DB instance deletion.

Lý do lựa chọn:
🛡️ Những thay đổi này trực tiếp ngăn chặn hành động xóa DB instance bằng cách:

  • Áp dụng nguyên tắc least privilege (quyền hạn tối thiểu) theo AWS IAM best practices, đảm bảo chỉ những user/role cần thiết mới có quyền delete.
  • Bật deletion protection trên RDS instance (tính năng built-in, phải disable thủ công mới xóa được).
  • Sử dụng ACL policy (Access Control List policy, thường là IAM policy hoặc resource-based policy trên RDS) để explicitly deny hành động rds:DeleteDBInstance.
    Kết hợp này tạo lớp bảo vệ đa tầng (defense-in-depth), giảm rủi ro human error trong production. Theo AWS Well-Architected Framework (Operations Pillar, cập nhật 2025), đây là khuyến nghị chuẩn cho môi trường critical như ecommerce.

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

Dưới đây là phân tích tất cả 5 phương án, giữ nguyên văn bản gốc bằng tiếng Anh. Mỗi phương án được đánh giá ✅ (đúng, nên chọn) hoặc ❌ (sai, không giúp giảm rủi ro xóa nhầm).

  • Grant least privilege to groups, IAM users, and roles.
    ✅ Đúng. Nguyên tắc least privilege đảm bảo IAM users/roles chỉ có quyền cần thiết (ví dụ: deny rds:DeleteDBInstance cho developer). Điều này ngăn developer production thực hiện delete, phù hợp AWS IAM Access Analyzer (cập nhật 2026 hỗ trợ auto-remediation). Không áp dụng dẫn đến quyền quá rộng, như trường hợp này.

  • Allow all users to restore a database from a backup.
    ❌ Sai. Phương án này mở rộng quyền cho tất cả user thực hiện restore, trái ngược least privilege và tăng rủi ro (user không quen có thể làm hỏng dữ liệu). Nó chỉ liên quan restore, không ngăn delete ban đầu – thậm chí khuyến khích hành động không kiểm soát.

  • Enable deletion protection on existing production DB instances.
    ✅ Đúng. Tính năng deletion protection của RDS (bật qua Console/CLI/API) chặn delete instance trừ khi disable thủ công, lý tưởng cho production Multi-AZ. Theo docs AWS 2026, áp dụng ngay cho existing instances qua ModifyDBInstance, giảm 100% rủi ro accidental delete mà không ảnh hưởng backup/snapshot.

  • Use an ACL policy to restrict users from DB instance deletion.
    ✅ Đúng. ACL policy (thường là IAM policy với Deny effect trên rds:DeleteDBInstance, hoặc DB instance resource policy) hạn chế cụ thể hành động delete. Kết hợp SCP (Service Control Policy) ở account root để enforce. Đây là lớp bảo vệ bổ sung cho deletion protection, theo AWS Security Pillar.

  • Enable AWS CloudTrail logging and Enhanced Monitoring.
    ❌ Sai. CloudTrail ghi log API calls (như delete RDS) để audit sau sự cố, Enhanced Monitoring theo dõi metrics CPU/network (không liên quan delete). Chúng không ngăn hành động xảy ra, chỉ giúp investigate post-mortem (ví dụ: tìm ai delete). Không giảm downtime tương lai.

📘 Tài liệu tham khảo (AWS Official Docs - 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 thêm ví dụ CLI, comment nhé.

Câu 158
A financial services company uses Amazon RDS for Oracle with Transparent Data Encryption (TDE). The company is required to encrypt its data at rest at all times. The key required to decrypt the data has to be highly available, and access to the key must be limited. As a regulatory requirement, the company must have the ability to rotate the encryption key on demand. The company must be able to make the key unusable if any potential security breaches are spotted. The company also needs to accomplish these tasks with minimum overhead.
What should the database administrator use to set up the encryption to meet these requirements?
  1. A AWS CloudHSM
  2. B AWS Key Management Service (AWS KMS) with an AWS managed key
  3. C AWS Key Management Service (AWS KMS) with server-side encryption
  4. D AWS Key Management Service (AWS KMS) CMK with customer-provided material
Xem giải thích

🧩 Giải thích 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 sử dụng Amazon RDS for Oracle với Transparent Data Encryption (TDE) để mã hóa dữ liệu tại chỗ (at-rest encryption). Họ có các yêu cầu nghiêm ngặt theo quy định:

  • 📱 Dữ liệu luôn được mã hóa tại chỗ.
  • 🔑 Khóa giải mã phải có tính sẵn sàng cao (highly available), giới hạn truy cập nghiêm ngặt.
  • ⚙️ Có thể xoay khóa (rotate key) theo yêu cầu (on demand).
  • 🚫 Có thể làm khóa không sử dụng được ngay lập tức nếu phát hiện rủi ro bảo mật.
  • 🛡️ Tối thiểu overhead vận hành (không muốn quản lý hạ tầng phức tạp).

Mục tiêu là chọn giải pháp mã hóa phù hợp cho DBA (database administrator) để đáp ứng tất cả các yêu cầu này trên AWS, sử dụng kiến thức cập nhật đến năm 2026 (phiên bản RDS và KMS mới nhất hỗ trợ TDE với KMS imported keys).

✅ Đáp án đúng: AWS Key Management Service (AWS KMS) CMK with customer-provided material

Lý do lựa chọn:

  • 🛡️ Hoàn hảo phù hợp tất cả yêu cầu:
    • Highly available: KMS tự động multi-AZ, replication toàn cầu.
    • Access limited: Sử dụng IAM policies và key policies chi tiết.
    • Rotate on demand: CMK (Customer Managed Key) hỗ trợ xoay thủ công (manual rotation) bằng cách tạo key version mới ngay lập tức.
    • Make unusable: Với customer-provided material (BYOK - Bring Your Own Key), bạn import key material từ HSM bên ngoài vào KMS CMK. Nếu breach, có thể xóa key material gốc bên ngoài hoặc disable/schedule deletion KMS key, làm khóa không thể giải mã dữ liệu ngay lập tức (ngay cả dữ liệu cũ).
    • Minimum overhead: KMS là managed service, không cần quản lý hardware/cluster.
  • 🆕 Cập nhật 2026: RDS Oracle TDE tích hợp sâu KMS imported keys, hỗ trợ envelope encryption cho TDE wallets.
  • Đây là lựa chọn tối ưu cho môi trường regulated như tài chính (FINRA/PCI-DSS).

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

  • ❌ AWS CloudHSM
    Sai vì: CloudHSM cung cấp HSM đầy quyền kiểm soát (FIPS 140-2 Level 3), highly available (multi-AZ cluster), rotate/disable tùy ý, nhưng overhead cao (phải tự quản lý cluster HSM, backup, scaling). Không phù hợp "minimum overhead". RDS Oracle TDE hỗ trợ CloudHSM nhưng phức tạp hơn KMS.

  • ❌ AWS Key Management Service (AWS KMS) with an AWS managed key
    Sai vì: AWS managed keys (do AWS tạo/quản lý) chỉ rotate tự động hàng năm, không hỗ trợ on-demand rotation. Customer không thể disable/delete key (AWS control). Không đáp ứng "rotate on demand" và "make unusable". Phù hợp basic encryption nhưng không cho regulated control.

  • ❌ AWS Key Management Service (AWS KMS) with server-side encryption
    Sai vì: "Server-side encryption" (SSE-KMS) chủ yếu dùng cho S3/EBS, không phải thuật ngữ chuẩn cho RDS TDE. RDS Oracle TDE dùng KMS keys trực tiếp cho wallet, nhưng option này mơ hồ/vague, không chỉ rõ CMK hay imported material. Không đảm bảo "make unusable" hoặc "rotate on demand" đầy đủ.

📘 Tài liệu tham khảo

🛠️ Lời khuyên DevOps: Sử dụng AWS Secrets Manager kết hợp IAM least-privilege cho TDE wallet rotation tự động qua Lambda. Test failover để verify HA!

Câu 159 Chọn nhiều đáp án
A company is setting up a new Amazon RDS for SQL Server DB instance. The company wants to enable SQL Server auditing on the database.
Which combination of steps should a database specialist take to meet this requirement? (Choose two.)
  1. A Create a service-linked role for Amazon RDS that grants permissions for Amazon RDS to store audit logs on Amazon S3.
  2. B Set up a parameter group to configure an IAM role and an Amazon S3 bucket for audit log storage. Associate the parameter group with the DB instance.
  3. C Disable Multi-AZ on the DB instance, and then enable auditing. Enable Multi-AZ after auditing is enabled.
  4. D Disable automated backup on the DB instance, and then enable auditing. Enable automated backup after auditing is enabled.
  5. E Set up an options group to configure an IAM role and an Amazon S3 bucket for audit log storage. Associate the options group with the DB instance.
Xem giải thích

🧩 Phân tích chi tiết câu hỏi trắc nghiệm AWS RDS for SQL Server Auditing

📖 Giải thích nội dung câu hỏi:
Câu hỏi yêu cầu một công ty đang thiết lập một instance Amazon RDS for SQL Server mới và muốn kích hoạt tính năng SQL Server auditing (ghi nhật ký kiểm toán SQL Server) trên cơ sở dữ liệu. Đây là câu hỏi chọn hai bước kết hợp (Choose two) mà chuyên gia cơ sở dữ liệu cần thực hiện để đáp ứng yêu cầu.
✅ Mục tiêu chính: Kích hoạt auditing để ghi lại các hoạt động cơ sở dữ liệu (như truy cập, thay đổi dữ liệu) và lưu trữ log vào Amazon S3 một cách an toàn.
🛠️ Bối cảnh AWS: Với RDS for SQL Server (phiên bản mới nhất hỗ trợ đến SQL Server 2019/2022 theo cập nhật 2025-2026), auditing được thực hiện qua Option Group (không phải Parameter Group), kết hợp với IAM role và service-linked role để RDS có quyền ghi log vào S3. Auditing hoạt động độc lập với Multi-AZ hay automated backups, không cần tắt chúng.

✅ Đáp án đúng (chọn TWO):
Hai lựa chọn đúng là:

  1. Create a service-linked role for Amazon RDS that grants permissions for Amazon RDS to store audit logs on Amazon S3.
    (Lý do: Service-linked role là bắt buộc để RDS có quyền tự động ghi audit logs vào S3 mà không cần can thiệp thủ công.)

  2. Set up an options group to configure an IAM role and an Amazon S3 bucket for audit log storage. Associate the options group with the DB instance.
    (Lý do: Option Group là cách chính thức để kích hoạt SQLSERVER_AUDIT option trên RDS SQL Server, chỉ định IAM role và S3 bucket để lưu log.)

🧐 Giải thích chi tiết từng phương án (đúng/sai):
Dưới đây là phân tích tất cả các 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ài liệu AWS RDS User Guide (cập nhật mới nhất 2026).

  • ✅ Create a service-linked role for Amazon RDS that grants permissions for Amazon RDS to store audit logs on Amazon S3.
    Đúng! 🏆 Service-linked role (như AWSServiceRoleForRDS) được tạo tự động hoặc thủ công để RDS có quyền s3:PutObject vào bucket S3. Không có role này, auditing sẽ thất bại khi cố ghi log. Đây là bước đầu tiên bắt buộc theo best practice AWS.

  • ❌ Set up a parameter group to configure an IAM role and an Amazon S3 bucket for audit log storage. Associate the parameter group with the DB instance.
    Sai! 🚫 Parameter Group chỉ dùng để cấu hình parameters động (như max connections, audit_level), không hỗ trợ cấu hình IAM role hay S3 bucket cho auditing. Auditing yêu cầu Option Group cụ thể với option SQLSERVER_AUDIT. Sử dụng parameter group sẽ không kích hoạt được tính năng.

  • ❌ Disable Multi-AZ on the DB instance, and then enable auditing. Enable Multi-AZ after auditing is enabled.
    Sai! ❌ Multi-AZ (high availability) không ảnh hưởng đến auditing. Auditing hoạt động bình thường trên Multi-AZ deployment (sync replication logs qua standby). Tắt Multi-AZ là không cần thiết và làm giảm độ sẵn sàng, vi phạm best practice AWS.

  • ❌ Disable automated backup on the DB instance, and then enable auditing. Enable automated backup after auditing is enabled.
    Sai! ❌ Automated backups không xung đột với auditing. Auditing logs được lưu riêng vào S3, độc lập với backup snapshots. Tắt backup làm mất tính năng recovery point, không phải yêu cầu để enable auditing theo docs AWS.

  • ✅ Set up an options group to configure an IAM role and an Amazon S3 bucket for audit log storage. Associate the options group with the DB instance.
    Đúng! 🏆 Đây là bước cốt lõi: Tạo Option Group mới, thêm option SQLSERVER_AUDIT với DBUser (admin), IAM role (cho phép RDS ghi S3), và S3 bucket ARN. Sau đó associate với DB instance. Chỉ hỗ trợ trên SQL Server Enterprise/Standard Edition.

📘 Tài liệu tham khảo (cập nhật mới nhất AWS 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ụ CLI/Console, hãy hỏi nhé!

Câu 160
A database specialist is creating an AWS CloudFormation stack. The database specialist wants to prevent accidental deletion of an Amazon RDS
ProductionDatabase resource in the stack.
Which solution will meet this requirement?
  1. A Create a stack policy to prevent updates. Include ג€Effectג€ : ג€ProductionDatabaseג€ and ג€Resourceג€ : ג€Denyג€ in the policy.
  2. B Create an AWS CloudFormation stack in XML format. Set xAttribute as false.
  3. C Create an RDS DB instance without the DeletionPolicy attribute. Disable termination protection.
  4. D Create a stack policy to prevent updates. Include ג€Effectג€ : ג€Denyג€ and ג€Resourceג€ : ג€ProductionDatabaseג€ in the policy.
Xem giải thích

🧩 Phân tích chi tiết câu hỏi trắc nghiệm AWS

📖 Giải thích nội dung câu hỏi:
Câu hỏi tập trung vào việc một chuyên gia cơ sở dữ liệu (database specialist) đang tạo một stack AWS CloudFormation. Họ muốn ngăn chặn việc xóa ngẫu nhiên (accidental deletion) tài nguyên Amazon RDS ProductionDatabase trong stack đó.
🛠️ Yêu cầu chính: Tìm giải pháp đảm bảo tài nguyên RDS không bị xóa khi thực hiện các hoạt động như update hoặc delete stack, tránh lỗi con người.
✅ Ngữ cảnh AWS: CloudFormation quản lý tài nguyên qua stack. Khi delete stack, tất cả tài nguyên sẽ bị xóa trừ khi có chính sách bảo vệ. Stack Policy là công cụ chính để kiểm soát thay đổi (như Deny Delete/Update trên resource cụ thể). Kiến thức này dựa trên phiên bản AWS CloudFormation mới nhất (2024-2026), không thay đổi cơ bản từ các bản trước.

✅ Đáp án đúng:
Create a stack policy to prevent updates. Include “Effect”: “Deny” and “Resource”: “ProductionDatabase” in the policy.
Lý do chọn đáp án này:
🛡️ Stack Policy cho phép Deny các hành động Update/Delete trên resource cụ thể ("ProductionDatabase"). Cú pháp đúng bao gồm "Effect": "Deny", "Action": "Update:*" (hoặc tương tự), và "Resource": "ProductionDatabase". Điều này ngăn stack policy từ chặn xóa ngẫu nhiên khi update/delete stack, ngay cả khi người dùng có quyền IAM đầy đủ. Đây là cách chuẩn AWS để bảo vệ resource trong production.

🔍 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 tiếng Anh. Mỗi phương án được đánh giá ✅ (đúng) hoặc ❌ (sai), kèm lý do chi tiết bằng tiếng Việt dựa trên docs AWS mới nhất.

  • ❌ Create a stack policy to prevent updates. Include “Effect”: “ProductionDatabase” and “Resource”: “Deny” in the policy.
    Phương án này sai hoàn toàn về cú pháp Stack Policy. "Effect" phải là "Deny" hoặc "Allow" (không phải tên resource như "ProductionDatabase"). "Resource" chỉ định tài nguyên cần bảo vệ (không phải "Deny"). Nếu áp dụng, policy sẽ không hợp lệ và không ngăn được xóa.

  • ❌ Create an AWS CloudFormation stack in XML format. Set xAttribute as false.
    Phương án hoàn toàn không tồn tại trong AWS CloudFormation. CloudFormation hỗ trợ YAML/JSON (không ưu tiên XML nữa từ 2016). Không có thuộc tính "xAttribute" nào liên quan đến bảo vệ xóa. Đây là lừa đảo (distractor), không áp dụng được.

  • ❌ Create an RDS DB instance without the DeletionPolicy attribute. Disable termination protection.
    Phương án này ngược lại với yêu cầu. Không có DeletionPolicy mặc định là SnapshotAndDelete hoặc Delete (dễ xóa). Disable termination protection (trên RDS console/EC2) cho phép terminate ngay lập tức. Để bảo vệ, phải dùng DeletionPolicy: Retain trong template VÀ enable termination protection – không phải cách này.

  • ✅ Create a stack policy to prevent updates. Include “Effect”: “Deny” and “Resource”: “ProductionDatabase” in the policy.
    Đúng 100%. Stack Policy với "Effect": "Deny" và "Resource": "ProductionDatabase" (kết hợp "Action": "Update:Delete" hoặc "Update:*") sẽ chặn mọi thay đổi xóa resource ngay cả khi delete/update stack. Áp dụng bằng aws cloudformation set-stack-policy.

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

  • AWS CloudFormation Stack Policies: Protecting a Stack's Resources – Hướng dẫn chính thức về Deny Delete.
  • RDS Deletion Protection: Termination Protection – Kết hợp với Stack Policy.
  • Exam Tips (DevOps Pro DOP-C02): Stack Policy là best practice cho production DB, ưu tiên hơn IAM roles.

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