Home > database >  DynamoDB CDC event ordering - Kinesis Data Streams vs DynamoDb streams
DynamoDB CDC event ordering - Kinesis Data Streams vs DynamoDb streams

Time:10-29

Reading the documentation for DynamoDB cdc streams, there is a table which lays out some of the differences between using Kinesis Data Streams and DynamoDB streams. The "Ordering of records" row says the following for Data Streams:

The timestamp attribute on each stream record can be used to identify the actual order in which changes occurred in the DynamoDB table.

vs DynamoDB Streams:

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.

I interpret this wording as DynamoDB streams guaranteeing ordering based on item modification order in dynamo where as this isn't guaranteed for Data streams. Is my interpretation correct?

Currently I'm using Data Streams for CDC, but need to make a new app which requires that records are in based on when they were inserted into dynamo. Can I continue to use Data Streams or should I enable DynamoDb streams as well?

CodePudding user response:

I interpret this wording as DynamoDB streams guaranteeing ordering based on item modification order in dynamo where as this isn't guaranteed for Data streams. Is my interpretation correct?

That is correct understanding. Item level ordering, which means modifications to a single item will be guaranteed to be in order of when the occurred.

Currently I'm using Data Streams for CDC, but need to make a new app which requires that records are in based on when they were inserted into dynamo. Can I continue to use Data Streams or should I enable DynamoDb streams as well?

I would use DynamoDB Streams as it streamlines having to maintain order across multiple shards of your stream.

  • Related