Domain 2: Storage COPY Flashcards
What is the write capacity for 1 WCU?
1 write per second up to 1KB each
Calculate these WCU:
• Example 1: we write 10 objects per second of 2 KB each.
• Example 2: we write 6 objects per second of 4.5 KB each
• Example 3: we write 120 objects per minute of 2 KB each
- Example 1: we write 10 objects per second of 2 KB each.
- We need 2 * 10 = 20 WCU
- Example 2: we write 6 objects per second of 4.5 KB each
- We need 6 * 5 = 30 WCU (4.5 gets rounded to the upper KB)
- Example 3: we write 120 objects per minute of 2 KB each
- We need 120 / 60 * 2 = 4 WCU
What is the read capacity for 1 strongly consistent RCU?
2 reads per second up to 4KB each
What is the read capacity for 1 eventually consistent RCU?
1 read per second up to 4KB each
Calculate these RCUs:
- Example 1: 10 strongly consistent reads per second of 4 KB each
- Example 2: 16 eventually consistent reads per second of 12 KB each
- Example 3: 10 strongly consistent reads per second of 6 KB each
- Example 1: 10 strongly consistent reads per second of 4 KB each
- We need 10 * 4 KB / 4 KB = 10 RCU
- Example 2: 16 eventually consistent reads per second of 12 KB each
- We need (16 / 2) * ( 12 / 4 ) = 24 RCU
- Example 3: 10 strongly consistent reads per second of 6 KB each
- We need 10 * 8 KB / 4 = 20 RCU (we have to round up 6 KB to 8 KB)
What is the maximum data size for a DynamoDB partition?
10GB
What is the maximum RCUs for a DynamoDB partition?
3000
What is the maximum WCUs for a DynamoDB partition?
1000
What is the maximum record size in DynamoDB?
400KB
What is the minimum record size in DynamoDB?
1 byte
How DynamoDB Scan works?
- Scan the entire table and then filter out data (inefficient)
- Returns up to 1 MB of data – use pagination to keep on reading
- Consumes a lot of RCU
- Limit impact using Limit or reduce the size of the result and pause
- For faster performance, use parallel scans:
- Multiple instances scan multiple partitions at the same time
- Increases the throughput and RCU consumed
- Limit the impact of parallel scans just like you would for Scans
- Can use a ProjectionExpression + FilterExpression (no change to RCU)
What is a Local Secondary Index (LSI) in DynamoDB?
It is an alternate range key for your table, local to the hash key.
It can only be defined at table creation time
What is a Global Secondary Index (GSI) in DynamoDB?
- It is a way to speed up queries on non-key attributes
- GSI = partition key + optional sort key
- The index is a new “table” and we can project attributes on it
What is the default DynamoDB TTL configuration duration?
48h
How can you store large objects using DynamoDB?
As DynamoDB max item size is 400kb, you can store the large object in S3 and store only its metadata in DynamoDB, pointing to the correct location.