> For the complete documentation index, see [llms.txt](https://anon-coders-notes.gitbook.io/techwriterdev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://anon-coders-notes.gitbook.io/techwriterdev/cloud/aws/developerassociate/services/20_dynamodb/05_transactions.md).

# Transactions

* Coordinated all or nothing operations *(update/delete/add)* to multiple items across one or more tables.
* This provides ACID guarantees.
* There are 3 read modes
  * Eventual Consistency
  * Strong Consistency
  * Transactional
* There are 2 write modes
  * Standard
  * Transactional
* It consumes twice the WCU and RCU. This is because DynamoDB performs 2 operations for every item *(prepare and commit)*.
* The two operations are
  * `TransactGetItems` → To do one or more `GetItem` operations.
  * `TransactWriteItems` → To do one or more `PutItem`, `UpdateItem` and `DeleteItem` operations.
* Use cases includes financial transactions, managing orders, multiplayer games etc.

## Transacional Capacity Computation

* To calculate transaction write capacity `WCU` the formula is,

  ```
      (Number of transactions) * (Item-size/1 KB) * 2 * (transactional cost)
  ```
* To calculate transaction read capacity `RCU` the formula is,

  ```
      (Number of transactions) * (Item-size rounded to upper factor of 4/4 KB) * 2 * (transactional cost)
  ```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://anon-coders-notes.gitbook.io/techwriterdev/cloud/aws/developerassociate/services/20_dynamodb/05_transactions.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
