AWS docs notes

First created: 2020-01-19 22:30

DynamoDB supports two types of primary keys:

  • Partition key: A simple primary key, composed of one attribute known as the partition key. Attributes in DynamoDB are similar in many ways to fields or columns in other database systems.
  • Partition key and sort key: Referred to as a composite primary key, this type of key is composed of two attributes. The first attribute is the partition key, and the second attribute is the sort key. Following is an example.

Reference: https://aws.amazon.com/cn/blogs/database/choosing-the-right-dynamodb-partition-key/

 

对partition key做hash function, 决定这条entry存储在哪个partition机器上。

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.

如果有sort key,再根据sort key升排序。这种情况Query时可以不提供sort key,所有partition key下的items将以升序返回。也可以根据sort key进行一定范围的查找。

Reference: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.Partitions.html

 

2020/01/23

Adaptive capacity is a feature in DynamoDB that can automatically adjust the throughput when there is an imbalanced or undistributed traffic due to hot key issue.

Adaptive capacity works by automatically increasing throughput capacity for partitions that receive more traffic.

Reference: https://aws.amazon.com/blogs/database/how-amazon-dynamodb-adaptive-capacity-accommodates-uneven-data-access-patterns-or-why-what-you-know-about-dynamodb-might-be-outdated/

posted @ 2021-01-19 10:16  YBgnAW  阅读(71)  评论(0编辑  收藏  举报