Question

Difficulty: EasyHigh-Performing Database Solutions

A logistics company is building a package tracking system that needs to ingest updates from various transit hubs. A solutions architect is designing an Amazon DynamoDB table to store these status updates. The system must support high-throughput write operations with sub-10 millisecond latency. Which partition key design should the solutions architect choose to maximize database write performance and avoid partition throttling?

  1. A unique Package ID as the partition keyAnswer
  2. B
    The date of the update formatted as YYYY-MM-DD as the partition key
  3. C
    A constant static string value as the partition key and the update timestamp as the sort key
  4. D
    A sequential auto-incrementing integer identifier as the partition key

Answer

A unique Package ID as the partition key
A unique Package ID provides a wide distribution of values (high cardinality). Amazon DynamoDB hashes this key to determine the physical partition for the item. High cardinality ensures that writes are evenly distributed across all partitions, maximizing overall write capacity and preventing write bottlenecks.

Step-by-Step Solution

1
Determine how Amazon DynamoDB allocates throughput and partitions data.
DynamoDB uses the partition key to hash and distribute data across physical partitions.
Understanding data distribution is crucial for avoiding hot partitions under high write load.
2
Compare the cardinality of a unique Package ID, a daily date format, a static string, and sequential integers.
A unique Package ID has the highest cardinality and random distribution, while dates, static values, and sequential IDs concentrate writes.
High-cardinality keys distribute writes evenly across multiple partitions, maximizing overall throughput.
3
Select the unique Package ID to ensure even write distribution and prevent partition throttling.
Write operations are balanced across all available physical partitions.
This design maintains sub-10 millisecond latency and scales performance workloads seamlessly.

Key Concept

Amazon DynamoDB partition key design and partition distribution
Estimated Time:50s
Rate this question