Hello. How do you handle automation with dynamodb ...
# help
j
Hello. How do you handle automation with dynamodb table replacement? For example, in development, I changed the primary keys of the dynamodb table. This will require replacement but will result to an error since it uses the same table name. There is an option of course to use for example the build number for uniqueness of the table name. Still, I would like to automate restoring data from the last backup of the table to be replaced. I just want to know how you would handle this kind of situation
f
Hey @John Stephen Soriao, as a side note, u wouldn’t run into this problem if u sed generic keys. Single table design is a good example for this - https://www.alexdebrie.com/posts/dynamodb-single-table/
Back to ur questions, the flow is usually: 1. creating a new table with a different name 2. copy over the data 3. have new table catch up to the old table (either by having the app write to both tables, or use streams) 4. flip the app to read/write from the new table 5. remove the old table