首页 > 解决方案 > AWS DynamoD Table 的 StreamSpecification 属性有什么用途?

问题描述

我正在玩 DynamoDb。我不确定 StreamSpecification 的目的是什么,为什么我们应该或不应该使用它?我已阅读文档Aws - StreamSpecification但它并没有解释它的作用。

MovieTable:
    Type: AWS::DynamoDB::Table
    Properties:
      BillingMode: PAY_PER_REQUEST
      AttributeDefinitions:
        - AttributeName: "Name"
          AttributeType: "S"
        - AttributeName: "Genre"
          AttributeType: "S"
        - AttributeName: "Rating"
          AttributeType: "N"
        - AttributeName: "DateReleased"
          AttributeType: "S"
      KeySchema:
      - AttributeName: "Name"
        KeyType: "HASH"
      - AttributeName: "Genre"
        KeyType: "RANGE"
      - AttributeName: "Rating"
        KeyType: "RANGE"
      - AttributeName: "DateReleased"
        KeyType: "RANGE"
      TimeToLiveSpecification:
        AttributeName: ExpireAfter
        Enabled: false
      SSESpecification:
        SSEEnabled: true

标签: node.jsamazon-web-servicesamazon-dynamodbamazon-cloudformation

解决方案


StreamSpecification允许您为此表启用可选的DynamoDB支持。DynamoDB Streams 允许您将表的所有更改作为读取- 您可以出于各种原因使用它,例如将相同的更改复制到另一个表、检查可疑活动等。您可以在此处阅读有关 DynamoDB Streams 功能的介绍。

如果你不想在你的桌子上启用一个流(因为你不知道这是什么,你可能不知道:-)),你可以忽略StreamSpecification.


推荐阅读