gpt4 book ai didi

amazon-web-services - 运动学数据流中的分片是什么

转载 作者:行者123 更新时间:2023-12-03 16:07:44 24 4
gpt4 key购买 nike

运动数据流和分区键中的分片是什么。我读过aws文档,但听不懂。有人可以简单地解释一下吗?

最佳答案

Amazon Kinesis Data Streams Terminology and Concepts - Amazon Kinesis Data Streams:

A shard is a uniquely identified sequence of data records in a stream. A stream is composed of one or more shards, each of which provides a fixed unit of capacity. Each shard can support up to 5 transactions per second for reads, up to a maximum total data read rate of 2 MB per second and up to 1,000 records per second for writes, up to a maximum total data write rate of 1 MB per second (including partition keys). The data capacity of your stream is a function of the number of shards that you specify for the stream. The total capacity of the stream is the sum of the capacities of its shards.


因此,分片有两个目的:
  • 一定数量的容量/吞吐量
  • 消息的有序列表

  • 如果您的应用程序必须 顺序处理所有消息,那么您只能使用一个分片。可以把它想象成银行的一条线-如果有一条线,那么每个人都会得到有序的服务。
    但是,如果只需要为消息的某些子集按 排序消息,则可以将它们发送到单独的分片。例如,银行中有多行,每行按顺序提供。或者,考虑发送GPS坐标的公交车。每条总线仅将消息发送到单个分片。一个分片可能包含来自多条总线的消息,但是每条总线仅发送到一个分片。这样,当处理来自该分片的消息时,将按顺序处理来自特定总线的所有消息。
    这是通过使用分区键来控制的,该键标识了源。分区键被散列并分配给一个分片。因此,所有具有相同分区键的消息将进入相同的分片。
    在后端,每个分片
    通常有一个 ,它按顺序处理来自该分片的消息。
    如果您的系统不关心保留消息顺序,请使用随机分区键。这意味着消息将被发送到任何分片。

    关于amazon-web-services - 运动学数据流中的分片是什么,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56514871/

    24 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com