Interview Prep/AWS/RDS, Aurora and DynamoDB

`TransactionCanceledException: Transaction cancelled, please refer cancellation reasons for specific reasons [None, ConditionalCheckFailed]`.

AdvancedTroubleshootingRDS, Aurora and DynamoDB
Answer

Likely causes → One item in TransactWriteItems failed, so the whole transaction rolled back. The reasons list matches the request order, so the second action's condition failed here. TransactionConflict in the list means a concurrent transaction touched the same item.

Diagnose →

aws dynamodb transact-write-items --transact-items file://tx.json 2>&1 | tail
# inspect CancellationReasons[].Code / Item in the SDK exception

Fix →

  1. Map each reason back to its action, and handle ConditionalCheckFailed as a business conflict
  2. Retry TransactionConflict with backoff
  3. Use a ClientRequestToken for idempotent retries

Prevent → Keep transactions small (up to 100 items), avoid hot items inside transactions, and log cancellation reasons in a structured form.

aws All AWS questions Roadmap: AWS core services

More on RDS, Aurora and DynamoDB