Estimate capacity consumption of lightweight transactions in Amazon Keyspaces - Amazon Keyspaces (for Apache Cassandra)

Estimate capacity consumption of lightweight transactions in Amazon Keyspaces

Lightweight transactions (LWT) allow you to perform conditional write operations against your table data. Conditional update operations are useful when inserting, updating and deleting records based on conditions that evaluate the current state.

In Amazon Keyspaces, all write operations require LOCAL_QUORUM consistency and there is no additional charge for using LWTs. The difference for LWTs is that when a LWT condition check results in FALSE, it consumes write capacity units. The number of write capacity units consumed depends on the size of the row. If the row size is 2 KB, the failed conditional write consumes two write capacity units. If the row doesn’t currently exist in the table, the operation consumes one write capacity unit. By monitoring the ConditionalCheckFailed metric in CloudWatch you can determine the capacity consumed by LWT condition check failures.