Tüm alıştırma soruları

1542 soru

Soru 1541Soru

A developer is building a high-throughput IoT logging application that writes status messages to an Amazon DynamoDB table. The write volume is approximately 500500 writes per second. The table is configured with 10001000 provisioned Write Capacity Units (WCUs). The primary key of the table is configured with `LogDate` (formatted as YYYY-MM-DD) as the partition key and `LogTimestamp` as the sort key. During peak hours, the application receives a high volume of `ProvisionedThroughputExceededException` errors.

Which action should the developer take to resolve the write throttling issue?

Cevabı ve açıklamayı göster

Cevap: Redesign the primary key to use a composite key consisting of a high-entropy attribute, such as a combination of DeviceID and LogDate, as the partition key.

Cevap

Redesign the primary key to use a composite key consisting of a high-entropy attribute, such as a combination of DeviceID and LogDate, as the partition key.
The correct answer is to redesign the primary key to use a composite partition key containing a high-entropy attribute, such as a combination of DeviceID and LogDate. This spreads the write request workload across multiple physical partitions, preventing a single partition from handling all the throughput and avoiding hot partition bottlenecks.

Adım Adım Çözüm

1
Analyze the cause of the ProvisionedThroughputExceededException errors when total provisioned capacity (10001000 WCUs) exceeds the write volume (500500 writes per second).
Identify that the partition key LogDate has low entropy (same value for all writes on a given day), directing all traffic to a single partition.
To understand why throttling occurs even though the total table throughput limit is not reached.
2
Determine the capacity limits of a single DynamoDB partition.
A single partition can support a maximum of 10001000 WCUs or 30003000 RCUs.
Explain why writing 500500 items per second to a single partition can trigger throttling if there are small bursts, and why increasing overall table WCUs will not resolve this limitation.
3
Evaluate key design strategies to distribute the write load.
Creating a composite partition key using DeviceID and LogDate distributes writes across multiple partitions based on the device ID.
To select a schema design that leverages DynamoDB's partitioning architecture to handle the required throughput.

Anahtar Kavram

Resolving DynamoDB throttling by designing high-entropy partition keys to distribute read and write throughput evenly across physical partitions.
Tahmini Süre:1m 30s
Soru 1542Soru

A developer is building a retail application that stores customer order histories in an Amazon DynamoDB table. The base table uses `OrderID` as the partition key. The application needs to support the following two query patterns efficiently:

- Retrieve all orders placed by a specific customer (`CustomerID`) sorted by the order date (`OrderDate`).
- Retrieve all orders that are currently in a `PENDING` status to process them in batches.

Which two database design strategies should the developer implement to meet these requirements with minimal latency and capacity consumption? (Select TWO.)

Geçerli olan tümünü seçin

Cevabı ve açıklamayı göster

Cevap: Create a Global Secondary Index (GSI) with `CustomerID` as the partition key and `OrderDate` as the sort key.; Create a Global Secondary Index (GSI) with `OrderStatus` as the partition key and `OrderID` or `OrderDate` as the sort key.

Cevap

Create a Global Secondary Index (GSI) with CustomerID as the partition key and OrderDate as the sort key, and create a Global Secondary Index (GSI) with OrderStatus as the partition key and OrderDate as the sort key.
The correct strategies are to create two Global Secondary Indexes (GSIs). The first GSI uses CustomerID as the partition key and OrderDate as the sort key, enabling efficient Query operations for a specific customer's orders sorted by date. The second GSI uses OrderStatus as the partition key and OrderDate as the sort key, allowing the application to query only the PENDING orders directly instead of scanning the entire table.

Adım Adım Çözüm

1
Analyze the first query pattern: retrieving orders for a specific CustomerID sorted by OrderDate.
Since CustomerID is not the partition key of the base table (OrderID is), a secondary index is required. Because the partition key of the index must be different from the base table's partition key, it must be a Global Secondary Index (GSI). Setting CustomerID as the partition key and OrderDate as the sort key enables querying orders for a specific customer pre-sorted by date.
To retrieve items sorted by a non-key attribute efficiently using the Query API.
2
Analyze the second query pattern: retrieving orders in a PENDING status.
Because OrderStatus is not the partition key of the base table, scanning the base table to find PENDING orders is highly inefficient. We need a secondary index with OrderStatus as the partition key. Because the partition key is different from the base table, it must be a GSI. We can query this GSI directly to retrieve only PENDING orders.
To avoid scanning the entire base table to find a small subset of items matching a specific status.
3
Evaluate and eliminate incorrect options.
Using Scan with FilterExpression is ruled out because it reads the entire table. Creating an LSI with CustomerID as the partition key is invalid because LSIs must share the base table's partition key (OrderID). Increasing provisioned capacity (RCUs) to sustain scans is a design anti-pattern and cost-inefficient.
To ensure correct database indexing design and optimize performance and cost.

Anahtar Kavram

Using Global Secondary Indexes (GSIs) to optimize read performance and support multiple query patterns without scanning the base table.
Tahmini Süre:2m 0s
ÖncekiSayfa 78 / 78
Tüm alıştırma soruları — AWS Certified Developer - Associate | Examkin