0
0
AWScloud~5 mins

Partition key and sort key in AWS - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is a partition key in AWS DynamoDB?
A partition key is the primary attribute used to distribute data across partitions in DynamoDB. It determines where the data is stored and helps in fast data retrieval.
Click to reveal answer
beginner
What role does the sort key play in DynamoDB?
The sort key allows DynamoDB to store multiple items with the same partition key but different sort keys. It helps organize and query data within the same partition.
Click to reveal answer
intermediate
How do partition key and sort key work together in DynamoDB?
Together, the partition key and sort key form a composite primary key. The partition key decides the partition, and the sort key orders items within that partition for efficient queries.
Click to reveal answer
intermediate
Why is choosing a good partition key important?
A good partition key evenly distributes data across partitions, preventing hotspots and ensuring fast, scalable performance.
Click to reveal answer
beginner
Can a DynamoDB table have only a partition key without a sort key?
Yes, a DynamoDB table can have just a partition key as its primary key. This means each item must have a unique partition key value.
Click to reveal answer
What does the partition key in DynamoDB determine?
AThe order of items within a partition
BThe physical location of data storage
CThe size of the database
DThe encryption method
What is the purpose of a sort key in DynamoDB?
ATo sort items within the same partition key
BTo distribute data across partitions
CTo encrypt data
DTo backup data
Can a DynamoDB table have a composite primary key?
AComposite keys are not supported
BNo, only partition key is allowed
COnly sort key is allowed
DYes, partition key and sort key together
What happens if the partition key is not well chosen?
AData will be encrypted automatically
BSort key will be ignored
CData may be unevenly distributed causing slow performance
DThe database size will increase
Is it mandatory to have a sort key in DynamoDB?
ANo, tables can have only a partition key
BYes, always required
COnly for encrypted tables
DOnly for global tables
Explain how partition key and sort key work together in DynamoDB to organize data.
Think about how data is grouped and sorted inside the database.
You got /4 concepts.
    Describe why choosing a good partition key is important for DynamoDB performance.
    Imagine how traffic flows on roads and how congestion slows things down.
    You got /4 concepts.