codereviewanskquestions
codereviewanskquestions

Reputation: 13998

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?

Upvotes: 6

Views: 8874

Answers (1)

Mike Dinescu
Mike Dinescu

Reputation: 55760

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.

Upvotes: 11

Related Questions