Amazon dynamodb 如何在DynamoDB中设置字符串字段的最大长度?

Amazon dynamodb 如何在DynamoDB中设置字符串字段的最大长度?,amazon-dynamodb,Amazon Dynamodb,可以约束字符串字段的最大长度吗 本文档仅描述字段的内部限制 Strings are Unicode with UTF-8 binary encoding. The length of a string must be greater than zero and is constrained by the maximum DynamoDB item size limit of 400 KB. The following additional constraints apply to primar

可以约束字符串字段的最大长度吗

本文档仅描述字段的内部限制

Strings are Unicode with UTF-8 binary encoding. The length of a string must be greater than zero and is constrained by the maximum DynamoDB item size limit of 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.

For a composite primary key, the maximum length of the second attribute value (the sort key) is 1024 bytes.

与传统的RDBMS不同,DynamoDB没有“最大列大小”的概念。唯一的限制是项目大小限制,正如您所提到的,400 KB。这是一个总限制,它包括属性名称长度和属性值长度。即,属性名称也计入总大小限制

阅读更多信息