Files
DVA-02-Notes/Study/Practice/Read and Write Units - Set 3.md
T

146 lines
5.7 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# DynamoDB Read/Write Units — Numeric Practice, Set 3
20 questions. Give a numeric answer for each, using `1 = <number>`, `2 = <number>`, and so on.
## Assumptions
- Assume provisioned capacity and steady workloads.
- All item sizes are exact DynamoDB item sizes, including attribute names and values.
- Each read accesses an individual item, not a Query or Scan. Transactional operations count individual items, not transaction API calls.
- Normal writes are non-transactional. All writes create new items.
- Ignore indexes, replication, retries, failed requests, burst capacity and partition limits.
- Questions 1–14 ask for exact throughput requirements: fractional RCU answers are valid; do not round the final result to a whole number.
- Questions 15–18 ask for the maximum number of individual item operations per second.
- Questions 19–20 ask for whole-number provisioned capacity settings.
## Questions
### 1. You normally write six separate 1.8 KB items every second. How many WCUs are required?
Writing to DynamoDB splits writes into 1KB blocks.
$2KB \times 6Hz = 12WCU$
Answer: 12 WCUs
### 2. You normally write nine separate 0.7 KB items every second. How many WCUs are required?
$1KB \times 9Hz = 9WCU$
Answer: 9 WCUs
### 3. You normally write four separate 3.01 KB items every second. How many WCUs are required?
$4KB \times 4Hz = 16WCU$
Answer: 16 WCUs
### 4. You transactionally write three separate 2.01 KB items every second. How many WCUs are required?
Transactional writes have $\times 2$ multiplier.
$3KB \times 3Hz \times 2 (transaction) = 18WCU$
Answer: 18WCUs
### 5. You transactionally write six separate 1 KB items every second. How many WCUs are required?
$1KB \times 6Hz \times 2(transaction) = 12WCU$
Answer: 12WCUs
### 6. You perform strongly consistent reads of five separate 5 KB items every second. How many RCUs of throughput are required?
Reading from DynamoDB splits reads into 4KB blocks.
$ceil(5KB/4KB) \times 5Hz = 2 \times 5Hz = 10RCU$
Answer: 10RCUs
### 7. You perform strongly consistent reads of three separate 12 KB items every second. How many RCUs of throughput are required?
$ceil(12KB/4KB) \times 3Hz = 3 \times 3Hz = 9RCU$
Answer: 9RCUs
### 8. You perform eventually consistent reads of nine separate 0.8 KB items every second. How many RCUs of throughput are required?
Eventually consistent reads have $\times 0.5$ multiplier.
$ceil(1KB/4KB) \times 9Hz \times 0.5(eventual) = 1 \times 9Hz \times 0.5 = 4.5RCU$
Answer: 4.5RCUs
### 9. You perform eventually consistent reads of five separate 8.01 KB items every second. How many RCUs of throughput are required?
$ceil(8.01KB/4KB) \times 5Hz \times 0.5(eventual)$
$= 3 \times 5Hz \times 0.5$
$= 15 \times 0.5$
$\therefore\ = 7.5 RCU$
Answer: 7.5RCUs
### 10. You perform eventually consistent reads of seven separate 8 KB items every second. How many RCUs of throughput are required?
$ceil(8KB/4KB) \times 7Hz \times 0.5(eventual) = 2 \times 7Hz \times 0.5 = 7RCU$
Answer: 7RCUs
### 11. You transactionally read five separate 4.01 KB items every second. How many RCUs of throughput are required?
Transactional reads have $\times 2$ multiplier.
$ceil(4.01KB/4KB) \times 5Hz \times 2(transaction) = 2 \times 5Hz \times 2 = 20 RCU$
Answer: 20RCUs
### 12. You transactionally read three separate 11 KB items every second. How many RCUs of throughput are required?
$ceil(11KB/4KB) \times 3Hz \times 2(transaction) =$
$=3 \times 3Hz \times 2$
$=18 RCU$
Answer: 18RCUs
### 13. Each second, you normally write two 0.6 KB items and three 2.4 KB items to the same table. How many WCUs are required in total?
$ceil(0.6KB/1KB) \times 2Hz + ceil(2.4KB/1KB) \times 3Hz$
$= 1 \times 2Hz + 3 \times 3Hz = 11WCU$
Answer: 11WCUs
### 14. Each second, you perform strongly consistent reads of two 5 KB items and eventually consistent reads of three 1 KB items from the same table. How many RCUs of throughput are required in total?
$ceil(5KB/4KB) \times 2Hz + ceil(1KB/4KB) \times 3Hz \times 0.5(eventual)$
$= 2 \times 2 + 1 \times 3 \times 0.5 = 4 + 1.5 = 5.5 RCU$
Answer: 5.5RCU
### 15. You have 28 WCUs available. What is the maximum number of normal item writes per second you can sustain if each item is 3.2 KB?
$floor(28 WCU / ceil(3.2KB/1KB))$
$= floor(28 WCU / 4 WCU) = 7Hz$
$\therefore$ 7 writes a second of 3.2KB items (up to 4KB @ 7Hz).
Answer: 7 writes a second.
### 16. You have 30 WCUs available. What is the maximum number of transactional item writes per second you can sustain if each item is 2.2 KB?
$floor(30WCU/ceil(2.2KB/1KB)/2(transaction))$
$=30WCU/3/2$
$=30WCU/6$
$=5Hz$
$\therefore$ 5 writes a second of 2.2KB items (up to 3KB @ 5Hz).
Answer: 5 writes a second.
### 17. You have 15 RCUs available. What is the maximum number of eventually consistent item reads per second you can sustain if each item is 9 KB?
$floor(15RCU/ceil(9KB/4KB)/0.5(eventual))$
$=floor(15RCU/3/0.5)$
$=floor(5/0.5)$
$=floor(10)$
$=10Hz$
$\therefore$ 10 reads a second of 9KB items (up to 12KB @ 10Hz).
Answer: 10 reads a second
### 18. You have 32 RCUs available. What is the maximum number of transactional item reads per second you can sustain if each item is 5 KB?
$floor(32RCU/ceil(5KB/4KB)/2(transaction))$
$=floor(32/2/2)$
$=32 / 4$
$= 8Hz$
Answer: 8 reads a second
### 19. You perform eventually consistent reads of eleven separate 3 KB items every second. What is the minimum WHOLE NUMBER of RCUs you must provision?
$ceil(3KB/4KB) \times 11Hz \times 0.5(eventual)$
$= 1 \times 11 \times 0.5 = 5.5RCU$
Answer: 6 RCUs
### 20. You perform eventually consistent reads of five separate 12.01 KB items every second. What is the minimum WHOLE NUMBER of RCUs you must provision?
$ceil(12.01KB/4KB) \times 5Hz \times 0.5(eventual)$
$= 4 \times 2.5$
$=10 RCU$
Answer: 10 RCU