DynamoDB流有序处理 [英] DynamoDB Stream in-ordering processing
问题描述
假设我有以下DynamoDB表及其条目:
Let's say I have following DynamoDB table with entries:
ABC //列
a1 b1 c1 //条目1
a1 b1 c1 // entry 1
a1 b2 c2 //条目2
a1 b2 c2 // entry 2
A是键(分区键), B是排序键(唯一),C是属性。
A is the key (partition key), B is the sort key (unique), C is an attribute.
我想确保DynamoDB流可以保证B的有序处理。
I'd like to make sure the DynamoDB streams can guarantee in-ordering processing for B.
如果以此顺序进行更改-(注释C更新了3次)
If changes made in this order - (note C updated 3 times)
{a1,b1,c1} = > {a1,b1,c2} => {a1,b1,c3}
{a1, b1, c1} => {a1, b1, c2} => {a1, b1, c3}
DynamoDB Stream是否可以保证排序?
看起来可以保证按顺序处理同一密钥上的更新。对于此示例,是否将保留对a1(键)的任何更新顺序?
Can DynamoDB Stream guarantee the ordering? Looks like in-order processing for updates on the same key is guaranteed. For this example, so the order of any update on a1 (key) will be preserved?
推荐答案
是的,该顺序得以保留因为在DynamoDB中,所有对项目的更改都是使用项目键(无论是仅分区的还是复合分区)进行的,并且DynamoDB流保证将所有突变按顺序准确地传递到每个项目。
Yes, the ordering is preserved because in DynamoDB all changes to items are made using the item key (whether partition-only, or composite) and DynamoDB Streams guarantee exactly once, in-order delivery of all mutations to each item.
来自 docs :
每个流记录在流中仅显示一次。
Each stream record appears exactly once in the stream.
对于在DynamoDB表中修改的每个项目,流
记录的出现顺序与对
项的实际修改相同。
For each item that is modified in a DynamoDB table, the stream records appear in the same sequence as the actual modifications to the item.
这篇关于DynamoDB流有序处理的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!