What a four-operation failure taught me about commits, cancellation reasons, and verifying that nothing was written.
A database transaction is easy to appreciate when it succeeds. The more important question is what happens when one operation fails after several other changes have been requested.
Suppose an application needs to create a record, update an existing balance, and delete an obsolete item. If a final validation check fails, none of those changes should be committed. Otherwise, the application could be left with data that describes a transaction that never actually completed.
I tested this behavior using Tables by ServerlessCreed and Amazon DynamoDB . The experiment had three parts: commit a valid transaction, deliberately fail the final condition in a second transaction, and correct the request before verifying the committed state independently with the AWS CLI.
The test used Tables v3.3.46 , a disposable DynamoDB table in us-east-1 , and on-demand capacity.…