Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

DynamoDB Stream in-ordering processing

Let's say I have following DynamoDB table with entries:

A B C // column

a1 b1 c1 // entry 1

a1 b2 c2 // entry 2

A is the key (partition key), B is the sort key (unique), C is an attribute.

I'd like to make sure the DynamoDB streams can guarantee in-ordering processing for B.

If changes made in this order - (note C updated 3 times)

{a1, b1, c1} => {a1, b1, c2} => {a1, b1, c3}

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?

like image 652
codereviewanskquestions Avatar asked Feb 08 '18 02:02

codereviewanskquestions


1 Answers

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.

From the docs:

  • Each stream record appears exactly once in the stream.

  • 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.

like image 122
Mike Dinescu Avatar answered Nov 14 '22 12:11

Mike Dinescu