Changing existing Dynamodb global table stream view type?

0

Hi there,

I'm looking to change the stream view type of a Dynamodb table from NEW_IMAGES to NEW_AND_OLD_IMAGES. I ran into an issue when I tried to regenerate the table stream ARN by disabling and re-enabling the stream with NEW_AND_OLD_IMAGES for the global table. The error returns that the global table can't have a disabled stream.

How am I suppose to go about updating the stream view type if I can't turn off/on the stream with the updated view type?

asked a month ago86 views
2 Answers
0

Unfortunately the only way to do this today is to drop the replicas from your table, and change the stream view type, then add the replicas again.

I always recommend using NEW_AND_OLD_IMAGES by default, even if you don't require both images, your use-case may change in the future.

profile pictureAWS
EXPERT
answered a month ago
-1

Changing the stream view type for an existing DynamoDB global table is not as straightforward as you might expect. Unfortunately, it's not possible to directly edit the StreamViewType once a stream has been set up. This limitation applies to both standard and global tables.

For global tables, the situation is even more restrictive because, as you've discovered, you can't disable the stream. Global tables require streams to be enabled at all times for replication purposes.

Given these constraints, the recommended approach to change the stream view type for a global table is as follows:

  1. Create a new global table with the desired StreamViewType (NEW_AND_OLD_IMAGES in your case).

  2. Migrate your data from the old table to the new one.

  3. Update your application to use the new table.

  4. Once you've verified everything is working correctly with the new table, you can delete the old one.

This process, while more involved, ensures that you can achieve the desired stream view type without violating the requirements for global tables. It's important to plan this migration carefully to minimize downtime and ensure data consistency.

Remember that when you set up the new global table, you'll need to specify the NEW_AND_OLD_IMAGES StreamViewType during the table creation process. This can be done through the AWS Management Console, AWS CLI, or SDKs when calling the CreateTable operation.

While this may not be the most convenient solution, it's currently the only way to change the stream view type for a global table while maintaining the required always-on stream functionality.
Sources
Change data capture for DynamoDB Streams - Amazon DynamoDB
CreateTable - Amazon DynamoDB
StreamSpecification - Amazon DynamoDB

profile picture
answered a month ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions