Soru

Zorluk: KolayResolving DynamoDB Throttling and Key Distribution Issues

A developer is troubleshooting an application named PixelStream that uploads high-resolution images. The application stores metadata in an Amazon DynamoDB table where the partition key is set to the upload date (formatted as YYYY-MM-DD). During peak hours, the application frequently encounters ProvisionedThroughputExceededException errors even though the table's overall consumed throughput is well below the provisioned write capacity limit. What is the most effective way to resolve this throughput issue?

  1. Redesign the partition key schema to use a more granular attribute, such as a unique Image ID, to distribute write requests evenly across partitions.Cevap
  2. B
    Increase the Amazon SQS visibility timeout of the incoming queue to allow the consumers more time to write records to the table.
  3. C
    Modify the application configuration to hardcode the AWS access keys and force the SDK client to throttle its own requests.
  4. D
    Modify the application queries to perform table Scan operations instead of Query operations to read data from all partitions.

Cevap

Redesign the partition key schema to use a more granular attribute, such as a unique Image ID, to distribute write requests evenly across partitions.
Redesigning the partition key schema to use a high-cardinality attribute, such as a unique Image ID, spreads write operations across multiple physical partitions, preventing any single partition from exceeding its individual throughput limits.

Adım Adım Çözüm

1
Analyze the table schema and error behavior.
Identify that the partition key is the upload date, which has very low cardinality and results in all writes for a given day hitting the same partition.
This confirms that the ProvisionedThroughputExceededException is caused by a hot partition key rather than exceeding the table's total capacity.
2
Determine the solution for even data distribution.
Select a partition key with high cardinality, such as a unique Image ID.
High-cardinality keys distribute write requests evenly across physical partitions, resolving partition-level write limits.

Anahtar Kavram

Selecting a partition key with high cardinality to distribute write requests evenly and avoid hot partition bottlenecks.
Tahmini Süre:1m 0s
Bu soruyu puanla