Home › Forums › AWS › AWS Certified Solutions Architect Associate › The importance of partition keys in DynamoDB tables › Reply To: The importance of partition keys in DynamoDB tables
-
Hello Theo,
Thank you for your feedback! Let me clarify why the correct answer is “Use partition keys with high-cardinality attributes, which have a large number of distinct values for each item.”
In the scenario, you’re tasked with improving the performance of a DynamoDB table by distributing the workload evenly and using provisioned throughput. DynamoDB uses partition keys to split data across multiple partitions. For optimal performance, it’s important that the partition keys have high-cardinality, meaning they have many unique values.
High-cardinality attributes (like unique customer IDs or order numbers) ensure that DynamoDB can spread data and traffic evenly across its partitions, preventing any single partition from being overwhelmed. This directly addresses the requirement to “distribute the workload evenly.”
On the other hand, low-cardinality attributes (like a simple status flag with only a few values such as “active” or “inactive”) would lead to uneven distribution of traffic, overloading certain partitions and making the database less efficient.
Hence, Option B is the best way to distribute the workload and improve database performance efficiently.
I hope this helps! Please feel free to ask if you need further clarification.
Regards,
Nikee @ Tutorials Dojo