简体   繁体   English

dynamodb 主键最大大小

[英]dynamodb primarykey max size

I have a dynamo table.我有一个发电机表。 It has primary key and sortkey.它有主键和排序键。 In dynamodb 1 partition can have max of 10GB of data.在 dynamodb 中,1 个分区最多可以有 10GB 的数据。 Can a single primary key be present in multiple partitions means single primary key have multiple sort keys which lead to more than 10GB and crosses partition boundary.单个主键是否可以存在于多个分区中意味着单个主键具有多个排序键,导致超过 10GB 并跨越分区边界。

Is there any limitation on max size of single primary/hash key ?单个主键/哈希键的最大大小是否有任何限制?

In short, there is no limitation on primary/sort key. 简而言之,对主键/排序键没有限制。 If you have Local Secondary Index (LSI) defined, then the total sizes of all table and index items cannot exceed 10 GB . 如果定义了本地二级索引(LSI),则所有表和索引项的总大小不能超过10 GB

In general, there is no practical limit on the number of distinct sort key values per partition key value. 通常,每个分区键值的不同排序键值的数量没有实际限制。

The exception is for tables with local secondary indexes. 具有本地二级索引的表例外。 With a local secondary index, there is a limit on item collection sizes: For every distinct partition key value, the total sizes of all table and index items cannot exceed 10 GB. 对于本地二级索引,项目集合的大小受到限制:对于每个不同的分区键值,所有表和索引项目的总大小不能超过10 GB。 This might constrain the number of sort keys per partition key value. 这可能会限制每个分区键值的排序键数。

Sort Key Values 排序键值

From the Amazon's Dynamo DB 's page来自亚马逊的Dynamo DB页面

Strings are Unicode with UTF-8 binary encoding.字符串是带有 UTF-8 二进制编码的 Unicode。 The minimum length of a string can be zero, if the attribute is not used as a key for an index or table, and is constrained by the maximum DynamoDB item size limit of 400 KB.如果该属性不用作索引或表的键,并且受 DynamoDB 项目大小上限 400 KB 的限制,则字符串的最小长度可以为零。

The following additional constraints apply to primary key attributes that are defined as type string:以下附加约束适用于定义为类型字符串的主键属性:

  • For a simple primary key, the maximum length of the first attribute value (the partition key) is 2048 bytes.对于简单的主键,第一个属性值(分区键)的最大长度为 2048 字节。
  • For a composite primary key, the maximum length of the second attribute value (the sort key) is 1024 bytes.对于复合主键,第二个属性值(排序键)的最大长度为 1024 字节。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM