Jason
Jason

Reputation: 557

AWS DynamoDB table Partition Key

Question about Partition Key in Dynamodb table.

It says Partition key – A simple primary key, composed of one attribute known as the partition key.

DynamoDB uses the partition key's value as input to an internal hash function. The output from the hash function determines the partition (physical storage internal to DynamoDB) in which the item will be stored.

Quetion: So If I have 1 million records in a Orders table with Orderid being the partition key. Does it mean each record of my Orders table is stored in 1 million servers? How is that is possible?

Upvotes: 0

Views: 398

Answers (1)

hunterhacker
hunterhacker

Reputation: 7122

The hash output determines the physical partition for placement. Say you have four partitions backing the table. If the hash output value is in the first quarter of the keyspace it goes into the first partition. And so on. The hash value output will determine into which of the four it goes.

Then partitions can split as needed, each one taking a subset of the keyspace of the old.

Upvotes: 1

Related Questions