【问题标题】:How Cassandra handle duplicated data when reading from SSTable从 SSTable 读取时,Cassandra 如何处理重复数据
【发布时间】:2018-12-05 17:11:19
【问题描述】:

在Datastax的documentation中,它说:

在写入期间,Cassandra 将每个新行添加到数据库中,而不 检查是否存在重复记录。这项政策使 同一行的多个版本可能存在于数据库中。

据我了解,这意味着可能有超过 1 个非压缩 SSTables 包含同一行的不同版本。 Cassandra 从这些 SSTable 中读取数据时如何处理重复数据?

【问题讨论】:

    标签: cassandra datastax


    【解决方案1】:

    @quangh :如文档中所述:

    This is why Cassandra performs another round of comparisons during a read process. When a client requests data with a particular primary key, Cassandra retrieves many versions of the row from one or more replicas. The version with the most recent timestamp is the only one returned to the client ("last-write-wins").

    所有的写操作都有一个相关的时间戳。在这种情况下,不同的节点将具有同一行的不同版本。但在读取操作期间,Cassandra 将选择具有最新时间戳的行。我希望这能解决您的疑问。

    【讨论】:

      猜你喜欢
      • 2018-09-15
      • 2014-11-11
      • 2016-08-09
      • 2021-06-10
      • 2017-08-21
      • 2017-02-13
      • 2015-05-21
      • 2020-07-11
      • 2020-01-23
      相关资源
      最近更新 更多