amazon-dynamodbamazon-dynamodb-streams

What happens to DynamoDB Stream when a table is dropped and re-deployed?


I have an application reading DynamoDB streams (Not Kinesis). The following series of events happens:

1.) A row in table A is deleted. Presumably, this is captured in the changestream.

2.) Before my client reads the most recent stream, the table is dropped and re-deployed. This is done using "yarn serverless remove" and "yarn serverless deploy".

3.) My client reads the streams.

The documentation says that the stream will be marked as "DISABLED" if the table is deleted using the API and then the stream is cleaned up 24 hours later. But what happens if the table is immediately re-created? Does the previous stream of changes get blown away and a new one created? Will my client ever even see the old stream, even if it still exists? I also don't know if the DeleteTable API call is used by yarn serverless and if the behavior for these calls with this tool differs.

The behavior I am seeing is that the deletion from step #1 is never seen by the client.


Solution

  • The stream is marked as disabled and is available for read only for 24 hours.

    When you create a new table, and add a DynamoDB stream, it'll create a net new stream with no relation to the old one.

    You can confirm this by the stream ARN being made up with the timestamp when it was enabled.

    Should the delete item get a 200 response, it'll be available in the stream. If not, then it may or may not be available.