A solutions architect is designing a high-throughput telemetry application on AWS. Thousands of IoT devices will send real-time environmental data every second. The architect decides to store the data in an Amazon DynamoDB table. The database schema is currently designed with `SensorType` (which has 4 unique values: 'Temperature', 'Humidity', 'Pressure', and 'AirQuality') as the partition key, and a timestamp as the sort key. During load testing, the application encounters write throttling errors even though the table has sufficient write capacity. Which modification to the database design should the solutions architect recommend to resolve the performance bottleneck?
- Redesign the table schema to use a high-cardinality attribute, such as a combination of `SensorID` and a daily date string, as the partition key to distribute write operations evenly across multiple partitions.Answer
- BKeep the current partition key but change the sort key to `SensorID` to allow DynamoDB to distribute the incoming write load across multiple partitions based on the sort key.
- CSwitch the DynamoDB table from provisioned capacity mode to on-demand capacity mode to automatically scale and bypass partition-level throughput limitations.
- DMigrate the database layer to an Amazon RDS Multi-AZ DB cluster and direct the write traffic to the read replicas to scale the write throughput.
Answer
Redesign the table schema to use a high-cardinality attribute, such as a combination of `SensorID` and a daily date string, as the partition key to distribute write operations evenly across multiple partitions.
The correct option is to redesign the table schema using a high-cardinality attribute. By using a partition key with high cardinality (such as `SensorID` or a combination of `SensorID` and a date), DynamoDB can distribute the write workload evenly across many physical partitions. This avoids hitting the partition-level limit of 1,000 Write Capacity Units (WCUs).
Step-by-Step Solution
Key Concept
DynamoDB partition key cardinality and partition-level throughput limits
Estimated Time:1m 30s