What would be the most appropriate way to enable transactionality of multi-operation updates on AWS DynamoDB in a Java Spring application?
AWS' DynamoDB is atomic only on a per-row update. I have a requirement to maintain secondary indices as separate tables, so I'd insert the 'main' row in the main table, and then insert a row into the secondary index table. If the second insert fails, I'd like to 'roll back' the first, in order to keep my data consistent. DynamoDB doesn't have any native support for transactions or rollbacks.
I'm familiar with using a Spring transaction manager when working with JPA datasources like Hibernate, but I'm not sure what the best approach to implementing my own transaction-management code would be.