Amazon Kinesis和有保证的订购 [英] Amazon Kinesis and guaranteed ordering

查看:66
本文介绍了Amazon Kinesis和有保证的订购的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Amazon声称其Kinesis流产品可保证记录排序。

Amazon claims their Kinesis streaming product guarantees record ordering.


它提供记录的排序以及读取和/或记录的功能。或以相同顺序重播记录(...)

It provides ordering of records, as well as the ability to read and/or replay records in the same order (...)

Kinesis由流组成,而流本身由一个或多个碎片组成。记录存储在这些碎片中。我们可以编写连接到Shard的消费者应用程序,并按照存储顺序读取/重放记录。

Kinesis is composed of Streams that are themselves composed of one or more Shards. Records are stored in these Shards. We can write consumer applications that connect to a Shard and read/replay records in the order they were stored.

但是Kinesis可以开箱即用地保证订购流自身而不将订购逻辑推送给消费者?使用者如何从同一Stream的多个分片中读取记录,以确保以将记录添加到Stream中的相同顺序读取记录?

But can Kinesis guarantee, out of the box, ordering for the Stream itself without pushing ordering logic to the consumers? How can a consumer read records from multiple Shards of the same Stream, making sure the records are read in the same order they were added to the Stream?

推荐答案

看来这不可能实现。保证在分片级别上订购,但不能保证在所有流中订购。

It seems this is not possible to achieve. Ordering is guaranteed on a shard level, but not across the all stream.

https://brandur.org/kinesis-order


所以回到我们原来的问题:我们如何保证所有
记录都按照产生它们的相同顺序使用?
的答案是我们不能,但我们不应该让不幸的
现实困扰我们太多。将流扩展到多个
分片之后,便无法使用任何机制来保证记录
在整个流中按顺序被使用;

So back to our original question: how can we guarantee that all records are consumed in the same order in which they’re produced? The answer is that we can’t, but that we shouldn’t let that unfortunate reality bother us too much. Once we’ve scaled our stream to multiple shards, there’s no mechanism that we can use to guarantee that records are consumed in order across the whole stream; only within a single shard.

这篇关于Amazon Kinesis和有保证的订购的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆