DynamoDB transactions are the tool for situations where several items have to be right together: a bike counts as rented, the customer has one more active rental on their account, and the rental exists as a record of its own. If one of these three steps is missing, you end up with a bike nobody can rent anymore, or a customer who suddenly rides three bikes at once. With TransactWriteItems , either everything happens or nothing does.
I care about this topic because teams often reach for DynamoDB transactions too late or too often. Too late, because many only notice after the first inconsistent record that three separate writes in a Lambda function are not a unit. Too often, because transactions consume twice the capacity and tend to collide with each other under concurrent load.…