Question

Difficulty: MediumHigh-Performing Database Solutions

A logistics company is designing an IoT tracking system that receives real-time location telemetry from 50,00050,000 delivery trucks. During peak operations, the application receives a high volume of write requests containing a truck ID, a current timestamp, and coordinates. The primary query pattern is to retrieve the historical route of a specific truck for a given day. The transmission rate of the telemetry fluctuates significantly throughout the day. Which database architecture and configuration should the solutions architect choose to meet these requirements with optimal write performance and cost-efficiency?

  1. A
    Deploy an Amazon DynamoDB table in on-demand capacity mode, setting the partition key as the timestamp and the sort key as the unique truck ID.
  2. B
    Deploy an Amazon RDS for MySQL Multi-AZ database, and write all telemetry to the primary instance. Scale the write performance by creating multiple read replicas, and configure them to act as the primary automatic failover targets.
  3. Deploy an Amazon DynamoDB table in on-demand capacity mode, setting the partition key as the unique truck ID and the sort key as the timestamp.Answer
  4. D
    Deploy an Amazon DynamoDB table in provisioned capacity mode with a fixed read and write capacity, setting the partition key as the unique truck ID and the sort key as the timestamp.

Answer

Deploy an Amazon DynamoDB table in on-demand capacity mode, setting the partition key as the unique truck ID and the sort key as the timestamp.
Deploying an Amazon DynamoDB table in on-demand capacity mode with the truck ID as the partition key is the optimal solution. The truck ID provides a high cardinality value, distributing the write load evenly across multiple partitions. The timestamp as the sort key allows historical querying of a specific truck's route. On-demand capacity mode automatically accommodates the fluctuating transmission rate without manual scaling or throttling.

Step-by-Step Solution

1
Analyze workload characteristics and database requirements.
The workload is write-heavy, fluctuates over time, requires high write throughput, and accesses data by truck ID (key-value lookup).
This helps determine if a relational database (RDS) or non-relational database (DynamoDB) is better suited for the scale and access patterns.
2
Select the partition key to distribute write traffic.
Using the unique truck ID as the partition key provides high cardinality, distributing writes evenly across multiple partitions and preventing a hot partition.
Choosing a monotonically increasing key like a timestamp would write-throttle the table by targeting a single partition at any given time.
3
Choose the database capacity mode.
Select on-demand capacity mode to handle fluctuating telemetry workloads automatically and cost-effectively.
Fixed provisioned capacity would result in throttling during spikes or high cost during idle times.

Key Concept

DynamoDB Partition Key Design and Capacity Modes
Estimated Time:1m 30s
Rate this question