mongock / mongock

Lightweight Java based migration tool

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

DynamoDb migration to add more than 24 TransactionWriteItems

EnergyPanda opened this issue · comments

I would like to be able to complete more than 24 TransactionWriteItems in one migration.

In the example for DynamoDb it only does the 24 then stops: https://github.com/mongock/mongock-examples/blob/master/dynamodb/springboot-quickstart-dynamodb/src/main/java/io/mongock/examples/dynamodb/springboot/migration/ClientInitializerChangeUnit.java#L29

How could I paginate (complete the 24 items, then do 24 more) to complete a larger migration?

This limitation comes from DynamoDB itself. If you wan to paginate it, which means having a set of transaction units, you lose the benefit of having your changes and the mongock's track in the same transaction, so Mongock managing the transactions won't report any benefit.

With that, you can ignore the DynamoDBTransactionItems transactionItems(remove it from the parameters list) and manage the transactions inside the ChangeUnit.