- Newest
- Most votes
- Most comments
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.
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:
-
Create a new global table with the desired StreamViewType (NEW_AND_OLD_IMAGES in your case).
-
Migrate your data from the old table to the new one.
-
Update your application to use the new table.
-
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
Relevant content
- asked 3 years ago
- asked 3 years ago