Soru

Zorluk: KolayResolving DynamoDB Throttling and Key Distribution Issues

A restaurant reservation system named TableReserve records guest bookings into an Amazon DynamoDB table. During peak hours, the application experiences performance degradation and receives multiple ProvisionedThroughputExceededException errors when writing reservation records. The table's partition key is ReservationDate (formatted as YYYY-MM-DD), causing all write requests for a specific date to target the same partition. Which TWO actions should the developer take to resolve these throttling issues and improve partition write distribution? (Select TWO.)

  1. Append a random hash or suffix to the partition key value when writing records to distribute the write load.Cevap
  2. Migrate the DynamoDB table from provisioned capacity mode to on-demand capacity mode to handle traffic spikes automatically.Cevap
  3. C
    Increase the Amazon SQS queue visibility timeout to give the application more time to process the reservation messages.
  4. D
    Modify the application code to retrieve data using Scan operations instead of Query operations.
  5. E
    Hardcode static AWS credentials in the AWS SDK client initialization to eliminate request authorization latency.

Cevap

The correct actions are appending a random suffix to the partition key value and migrating the table to on-demand capacity mode.
The correct solution involves appending a random suffix to the partition key (write sharding) to distribute writes across multiple partitions and migrating to on-demand capacity mode to handle reservation spikes dynamically.

Adım Adım Çözüm

1
Analyze the DynamoDB partition key design.
Using ReservationDate (YYYY-MM-DD) results in a hot partition key because all reservations for a given day hit the same partition.
Identifying the root cause helps determine that the database throughput degradation is due to poor write distribution.
2
Apply write sharding by appending a random suffix to the partition key.
Writes are distributed across multiple partitions (e.g., YYYY-MM-DD#1, YYYY-MM-DD#2).
This distributes the workload uniformly and resolves hot partition throttling.
3
Configure the table to use on-demand capacity mode.
DynamoDB dynamically scales to handle peak booking traffic automatically.
This accommodates spikes in reservations without manual capacity provisioning adjustments.

Anahtar Kavram

Resolving DynamoDB throttling issues by redesigning the partition key schema (sharding) and adjusting the table capacity mode.
Bu soruyu puanla