Composite Primary Key Flashcards

1
Q

DynamoDB - Composite Primary Key

A

How a Primary Key with a Partition and Sort Key Chooses Which Partition

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

New Data Example

A

Alien: Romulan

Example sentence

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Primary Key Structure

A

Partition Key: Alien
• 1 to 255 characters, case sensitive
Sort Key: Name (optional)
• 1 to 255 characters, case sensitive

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Important Points

A

The combination of Partition Key and Sort Key must be unique.
DynamoDB’s Internal Hash Function is a secret, and we have no idea how the algorithm decides which partition to write data

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Partition Distribution

A

Partition A:
• Alien: Cardassian, Name: Dukat
• Alien: Cardassian, Name: Dumar
Partition B:
• Alien: Klingon, Name: Worf
• Alien: Klingon, Name: Kor
Partition C:
• Alien: Romulan, Name: Tomalok
• Alien: Romulan, Name: Toreth
• Alien: Romulan, Name: Valdore

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Key Concepts

A

When using a Sort Key, the records with the same Partition Key are kept together and sorted A-Z by the Sort Key

Key concept explanation

How well did you know this?
1
Not at all
2
3
4
5
Perfectly