From 11052fbd96058593faf2caa914f6c89f6f7a1b0205c5a6cb226f621543d670e9 Mon Sep 17 00:00:00 2001 From: Rijndael Date: Mon, 2 Nov 2026 22:32:03 +0000 Subject: [PATCH] rewrote the formula --- Study/DynamoDB/ReadWriteUnits.md | 32 +++++++++++--------------------- 1 file changed, 11 insertions(+), 21 deletions(-) diff --git a/Study/DynamoDB/ReadWriteUnits.md b/Study/DynamoDB/ReadWriteUnits.md index b1149bb..e885b40 100644 --- a/Study/DynamoDB/ReadWriteUnits.md +++ b/Study/DynamoDB/ReadWriteUnits.md @@ -1,28 +1,18 @@ # Read / Write Capacity Units This is for [[_DynamoDB|DynamoDB]]. -## Writing -Math goes sort of like this: +The general formula for $CU$s is $$ \begin{aligned} -w &= \text{write} \\ -tw &= \text{transactional write} \\ -\ \\ -1\ WCU &= 1\ kb/w/s \\ -2\ WCU &= 1\ kb/tw/s \\ -\end{aligned} -$$ -Take away is that a 1KB write is 1WCU. And a 1KB [transactional]{.underline} write is 2WCU. -## Reading -The math for reading is a little bit more convoluted, because the reads are divided by 4KB blocks. -$$ -\begin{aligned} -cr &= \text{consistent read} \\ -ecr &= \text{eventually consistent read} \\ -tr &= \text{transactional read} \\ -\ \\ -1\ RCU &= 4kb/cr/s \\ -\frac{1}{2}\ RCU &= 4kb/ecr/s \\ -2 RCU &= 4kb/tr/s +rHz =& \frac{kCU / m}{ceil(nKB/bKB)} \\\ \\ +kCU =& ceil(nKB / bKB) \times rHz \times m \\\ \\ +\text{where:} \\ +nKB =& \text{ input size in KB} \\ +bKB =& \text{ operation block size: 1KB for Writes and 4KB for Reads} \\ +rHz =& \text{ request rate} \\ +m =& \text{ modifier: } \\ +&0.5\text{ for eventually consistent operations, } \\ +&1\text{ for normal operations, } \\ +&2\text{ for transactional operations} \end{aligned} $$