Do DynamoDB transaction charge per write of the individual record, or does it charge based upon the charge of the overallsize?
I am making a chat application where I want to store each of the user's chatrooms in a record so that when the user logs in, I can do a getItem with their username, rather than a scan for each of the chatrooms they are a part of. I am using Appsync as the API for the service. When a new chatroom is create by the user, I would append a uuid to each of the users added to the chat.
DynamoDB does not support batchUpdates, but does support Transactions, where I can batch multiple updates together. If I were to run DynamoDB updates through a loop to append the uuid, each of the updates would be rounded up to 1kb charge per user. If the transaction charges based upon the size of the transaction bundled together, the charges would be less since it would round up the total transaction, instead of the parts.
Transact writes (and all writes in fact) are per individual item. It’s only Query and Scan calls where the cost is based on the total full payload returned.