rewrote the formula

This commit is contained in:
Rijn committed 2026-11-02 22:32:03 +00:00
1 parent 426a9c36ed
commit 11052fbd96
1 file changed
+11 -21
+11 -21
View File
@@ -1,28 +1,18 @@
# Read / Write Capacity Units # Read / Write Capacity Units
This is for [[_DynamoDB|DynamoDB]]. This is for [[_DynamoDB|DynamoDB]].
## Writing The general formula for $CU$s is
Math goes sort of like this:
$$ $$
\begin{aligned} \begin{aligned}
w &= \text{write} \\ rHz =& \frac{kCU / m}{ceil(nKB/bKB)} \\\ \\
tw &= \text{transactional write} \\ kCU =& ceil(nKB / bKB) \times rHz \times m \\\ \\
\ \\ \text{where:} \\
1\ WCU &= 1\ kb/w/s \\ nKB =& \text{ input size in KB} \\
2\ WCU &= 1\ kb/tw/s \\ bKB =& \text{ operation block size: 1KB for Writes and 4KB for Reads} \\
\end{aligned} rHz =& \text{ request rate} \\
$$ m =& \text{ modifier: } \\
Take away is that a 1KB write is 1WCU. And a 1KB [transactional]{.underline} write is 2WCU. &0.5\text{ for eventually consistent operations, } \\
## Reading &1\text{ for normal operations, } \\
The math for reading is a little bit more convoluted, because the reads are divided by 4KB blocks. &2\text{ for transactional operations}
$$
\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
\end{aligned} \end{aligned}
$$ $$