An IoT telemetry platform receives status updates from devices, with each device sending an update every seconds. A solutions architect is designing an Amazon DynamoDB table to store these updates. The system must support a write volume of writes per second with sub-millisecond latency. The primary query pattern is to retrieve all status updates for a specific day, sorted by the recording timestamp, with a target latency of under milliseconds.
To meet these requirements, the architect initially designs the table with a partition key of `status_date` (formatted as `YYYY-MM-DD`) and a sort key of `timestamp#device_id`. During load testing, the application experiences write throttling and receives `ProvisionedThroughputExceededException` errors, even though the total provisioned Write Capacity Units (WCUs) are set high enough to handle the workload.
Which database design modification will resolve this bottleneck while meeting the performance and query requirements?
- Redesign the table to use `device_id` as the partition key and `timestamp` as the sort key. Create a Global Secondary Index (GSI) with a partition key of `status_date_shard` (combining the date with a calculated hash prefix between and ) and a sort key of `timestamp`. Configure the application to query all GSI shards in parallel for a given date and merge the results.Cevap
- BRedesign the table to use `device_id` as the partition key and `timestamp` as the sort key. Create a Global Secondary Index (GSI) with a partition key of `status_date` and a sort key of `timestamp`. Configure the application to query the GSI to retrieve the daily data.
- CEnable Amazon DynamoDB Accelerator (DAX) for the table, and update the application to write all status updates through the DAX cluster using a write-through caching strategy.
- DMigrate the database to Amazon RDS for PostgreSQL. To distribute the write workload and prevent bottlenecks on the primary instance, configure the application to send write operations to the RDS Read Replicas, which will automatically sync and failover if the primary instance is overloaded.