【问题标题】:What is the purpose of the AmplifyDataStore DynamoDB table?Amplify DataStore DynamoDB 表的用途是什么?
【发布时间】:2021-05-08 07:58:17
【问题描述】:

上下文

在使用 AWS Amplify JS 时,特别是 SDK 的 DataStore 部分,您在 schema.graphql 中指定的每个模型都会获得一个关联的 DynamoDB 表:

schema.graphql

type Blog @model {
  id: ID!
  name: String!
  posts: [Post] @connection(name: "BlogPosts")
}
type Post @model {
  id: ID!
  title: String!
  blog: Blog @connection(name: "BlogPosts")
  comments: [Comment] @connection(name: "PostComments")
}
type Comment @model {
  id: ID!
  content: String
  post: Post @connection(name: "PostComments")
}

这对应于在 AWS 中创建的 4 个 DynamoDB 表

  • Blog-somerandomstring-dev —(有道理)
  • Post-somerandomstring-dev —(有道理)
  • Comment-somerandomstring-dev —(有道理)
  • AmplifyDataStore-somerandomstring-dev —(这个表是从哪里来的?)

问题

鉴于上述情况,这个额外表 (AmplifyDataStore-somerandomstring-dev) 背后的解释和/或功能是什么?

【问题讨论】:

    标签: amazon-dynamodb aws-amplify aws-amplify-cli


    【解决方案1】:

    回答

    这个额外的表不是由 Amplify Graphql 架构中的任何特定 @model 创建的,称为 Delta Sync Table,其目的是帮助冲突检测和同步

    这可能意义不大,但doc 的其余部分解释了 Amplify/AppSync 如何为您的数据解决冲突。

    【讨论】:

      猜你喜欢
      • 2022-12-14
      • 1970-01-01
      • 1970-01-01
      • 2012-06-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2010-09-27
      • 2011-12-17
      相关资源
      最近更新 更多