Question

Difficulty: MediumOptimizing Performance with Caching and DAX

A logistics company operates an IoT fleet monitoring dashboard. Telemetry data from devices is continuously written to an Amazon DynamoDB table. The table's partition key is `device_type` (which has three distinct values) and its sort key is `timestamp`. During peak periods, the application receives a high volume of writes and experiences `ProvisionedThroughputExceededException` errors. To resolve this, a developer deploys an Amazon DynamoDB Accelerator (DAX) cluster in front of the table and updates the application to write through the DAX client. However, the write throttling errors persist. Which of the following explains why the write throttling continues and provides the correct resolution?

  1. A
    The DAX cluster size is too small to handle the write volume. The developer should scale the DAX cluster horizontally by adding more read replicas to distribute the write traffic.
  2. B
    The dashboard application is executing Scan operations to locate the devices before performing updates. The developer should replace these Scan operations with Query operations to resolve the throttling.
  3. DAX is a write-through cache and does not shield the DynamoDB table from write throttling. The developer must redesign the table schema to use a high-cardinality partition key like `device_id`.Answer
  4. D
    The developer should deploy an Amazon ElastiCache for Memcached cluster to cache the write operations, as ElastiCache scales write throughput horizontally across multiple nodes.

Answer

DAX is a write-through cache and does not shield the DynamoDB table from write throttling. The developer must redesign the table schema to use a high-cardinality partition key like `device_id` to distribute writes evenly across partitions.
The correct choice explains that Amazon DynamoDB Accelerator (DAX) is a write-through cache, meaning write requests are forwarded directly to the backend DynamoDB table. Deploying DAX does not prevent write throttling on the underlying database. The write throttling is caused by a hot partition key because the partition key (`device_type`) has low cardinality (only three values). Changing the partition key to a high-cardinality attribute like `device_id` ensures that writes are distributed across multiple partitions.

Step-by-Step Solution

1
Identify the operation type experiencing throttling.
The application is experiencing `ProvisionedThroughputExceededException` specifically during write operations.
Understanding whether read or write capacity is exhausted helps narrow down the effectiveness of DAX, which behaves differently for reads versus writes.
2
Analyze the architecture of DAX and its write behavior.
DAX is a write-through cache. Writes are written to DAX and synchronously written to the DynamoDB table.
This confirms that deploying DAX does not shield DynamoDB from write throttling.
3
Evaluate the table's partition key design.
The partition key `device_type` has low cardinality (only 3 unique values), leading to all write traffic targeting a few partitions.
A low-cardinality partition key causes a hot partition issue. Redesigning the schema to use a high-cardinality key like `device_id` resolves the write throttling.

Key Concept

Amazon DynamoDB Accelerator (DAX) is a write-through cache, meaning write requests are forwarded directly to the backend DynamoDB table. It does not queue or buffer write operations to protect DynamoDB from write capacity exhaustion or hot partitions. Redesigning the schema with a high-cardinality partition key is necessary to address write hot partitions.
Rate this question